How do I make a text style preference?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- NikMacPattyWak
- Newbie
- Posts: 10
- Joined: Thu Sep 28, 2017 2:21 pm
- Projects: Socializing Simulator
- Github: nikkimacahon
- Contact:
How do I make a text style preference?
I want to use a recurring on screen text (not tied to any characters or dialogue) that with special formatting and I don't want to have to specific that text formatting every time I want to use that text. Is there a way to make a text style preference so that I only need to define that formatting once?
-Nikki
nikkimacahon.com
nikkimacahon.com
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: How do I make a text style preference?
You could make a screen like thisNikMacPattyWak wrote: ↑Sat Jan 26, 2019 2:42 pmI want to use a recurring on screen text (not tied to any characters or dialogue) that with special formatting and I don't want to have to specific that text formatting every time I want to use that text. Is there a way to make a text style preference so that I only need to define that formatting once?
Code: Select all
screen special():
frame:
pos (50, 100)
padding (5,5,5,5)
text "qwerty bngt" size 17 color "#F00"
timer 4.0 action Hide("special")
You show the text with
show screen special
it will automatically hide after 4 sec. (or what ever time you want to set) as it is set up.
Is this what your looking for?
- NikMacPattyWak
- Newbie
- Posts: 10
- Joined: Thu Sep 28, 2017 2:21 pm
- Projects: Socializing Simulator
- Github: nikkimacahon
- Contact:
Re: How do I make a text style preference?
Kinda. I want the text to change but the font/size/color/etc. to stay the same. I essentially want it to be an on-screen prompt that changes from encounter to encounter. Like "So-and-So wants to borrow your pencil" or "This person is asking you to prom". Different text, same formatting.Per K Grok wrote: ↑Sun Jan 27, 2019 3:31 pmYou could make a screen like thisNikMacPattyWak wrote: ↑Sat Jan 26, 2019 2:42 pmI want to use a recurring on screen text (not tied to any characters or dialogue) that with special formatting and I don't want to have to specific that text formatting every time I want to use that text. Is there a way to make a text style preference so that I only need to define that formatting once?You can format the text as you want.Code: Select all
screen special(): frame: pos (50, 100) padding (5,5,5,5) text "qwerty bngt" size 17 color "#F00" timer 4.0 action Hide("special")
You show the text with
show screen special
it will automatically hide after 4 sec. (or what ever time you want to set) as it is set up.
Is this what your looking for?
-Nikki
nikkimacahon.com
nikkimacahon.com
- Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
- Contact:
Re: How do I make a text style preference?
NikMacPattyWak wrote: ↑Mon Jan 28, 2019 1:02 pm----
Kinda. I want the text to change but the font/size/color/etc. to stay the same. I essentially want it to be an on-screen prompt that changes from encounter to encounter. Like "So-and-So wants to borrow your pencil" or "This person is asking you to prom". Different text, same formatting.
If you change the code as below you can chose whatever message you want each time you show the screen.
If you want you could have an additional argument for the time before the screen hides.
Code: Select all
screen special(message):
frame:
pos (50, 100)
padding (5,5,5,5)
text message size 17 color "#F00"
timer 4.0 action Hide("special")
-----
show screen special("qwerty bngt")
- NikMacPattyWak
- Newbie
- Posts: 10
- Joined: Thu Sep 28, 2017 2:21 pm
- Projects: Socializing Simulator
- Github: nikkimacahon
- Contact:
Re: How do I make a text style preference?
Thank you!Per K Grok wrote: ↑Mon Jan 28, 2019 2:17 pm
If you change the code as below you can chose whatever message you want each time you show the screen.
If you want you could have an additional argument for the time before the screen hides.
Code: Select all
screen special(message): frame: pos (50, 100) padding (5,5,5,5) text message size 17 color "#F00" timer 4.0 action Hide("special") ----- show screen special("qwerty bngt")
-Nikki
nikkimacahon.com
nikkimacahon.com
Who is online
Users browsing this forum: Bing [Bot]