[SOLVED] Creating a tooltip/Increasing textbutton text size
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.
- PhZXgames
- Regular
- Posts: 49
- Joined: Fri Oct 14, 2016 2:12 pm
- Completed: Character Creation Frame
- Projects: RWBY Dawnfall
- Organization: PhZX Games
- Skype: live:phzxgames
- Location: Minnesota, USA
- Contact:
[SOLVED] Creating a tooltip/Increasing textbutton text size
So I need help with two things.
One, I want to create a tooltip, so when the player hovers over the textbutton, it can explain the option in a little text box that appears to where the mouse is. I know it has something to do with the "Hover" property and I would probably have to create another screen, but If anyone has any better ideas that could help, please tell.
two, How do you make the text in textbuttons bigger and/or change it's color? It's a pain to look at them in their tiny, default color imperfectioness.
Thanks!
One, I want to create a tooltip, so when the player hovers over the textbutton, it can explain the option in a little text box that appears to where the mouse is. I know it has something to do with the "Hover" property and I would probably have to create another screen, but If anyone has any better ideas that could help, please tell.
two, How do you make the text in textbuttons bigger and/or change it's color? It's a pain to look at them in their tiny, default color imperfectioness.
Thanks!
Last edited by PhZXgames on Sun Jan 01, 2017 6:33 am, edited 1 time in total.
"Don't Explode!"
-me
-me
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Creating a tooltip/Increasing textbutton text size
Have you read through the documentation?
There's a section devoted specifically to this for you.
Starting on line 147 of the default gui.rpy, you can see how to change buttons.
At line 169, you see this:
This means that anywhere in screens "gui.button_text_idle_color" is defined, it will use "gui.idle_color"
You can either delete "gui.idle_color" from the end of the line and replace it with a string Renpy accepts - for example, '#ffffff' or you can track down "gui.idle_color" in the same document, and change that.
In this case, it is line 29:
Simply change '#555555' to something else.
As for the other colors, sizes etc. same deal, just look for the specific line you want.
Tooltips:
Same deal, in the documentation and even in the tutorial that comes with Ren'Py, you should be able to see some examples.
Take my extras screen for example:
In this, the textbutton defines what is shown on screen.
default tt = Tooltip("") defines what is shown when the button is idle (not hovered or in use) - in my example, it is blank. Nothing will show until I move my mouse over it or navigate to it via keyboard.
action () is just that, an ordinry action button - what happens if you click it. set the action to None if you want the button to do nothing. Null and Pass may also work, I'm not sure on that though.
hovered tt.Action() defines what the tooltip that is displayed will be.
text tt.value is just where you want the tooltip to show. You could probably place it more than once, but I haven't tested that yet.
Here's an example of what that looks like.
There's a section devoted specifically to this for you.
Starting on line 147 of the default gui.rpy, you can see how to change buttons.
At line 169, you see this:
Code: Select all
# The color of button text in various states.
define gui.button_text_idle_color = gui.idle_color
define gui.button_text_hover_color = gui.hover_color
define gui.button_text_selected_color = gui.selected_color
define gui.button_text_insensitive_color = gui.insensitive_colorYou can either delete "gui.idle_color" from the end of the line and replace it with a string Renpy accepts - for example, '#ffffff' or you can track down "gui.idle_color" in the same document, and change that.
In this case, it is line 29:
Code: Select all
define gui.idle_color = '#555555'As for the other colors, sizes etc. same deal, just look for the specific line you want.
Tooltips:
Same deal, in the documentation and even in the tutorial that comes with Ren'Py, you should be able to see some examples.
Take my extras screen for example:
Code: Select all
screen extra:
tag menu
use game_menu(_("Extra"), scroll="viewport"):
vbox:
default tt = Tooltip("")
textbutton "Prologue":
action Start("prologue")
hovered tt.Action("Read the prologue")
textbutton "Lore":
action ShowMenu("lore_screen")
hovered tt.Action("Read world Lore")
text tt.value
default tt = Tooltip("") defines what is shown when the button is idle (not hovered or in use) - in my example, it is blank. Nothing will show until I move my mouse over it or navigate to it via keyboard.
action () is just that, an ordinry action button - what happens if you click it. set the action to None if you want the button to do nothing. Null and Pass may also work, I'm not sure on that though.
hovered tt.Action() defines what the tooltip that is displayed will be.
text tt.value is just where you want the tooltip to show. You could probably place it more than once, but I haven't tested that yet.
Here's an example of what that looks like.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- PhZXgames
- Regular
- Posts: 49
- Joined: Fri Oct 14, 2016 2:12 pm
- Completed: Character Creation Frame
- Projects: RWBY Dawnfall
- Organization: PhZX Games
- Skype: live:phzxgames
- Location: Minnesota, USA
- Contact:
Re: Creating a tooltip/Increasing textbutton text size
Thanks on the tooltip, that works and I now understand it.
But the color/size thing, I'm sorry for not being more specific. How do I change the text size/color for one specific textbutton? Is there a property for that?
But the color/size thing, I'm sorry for not being more specific. How do I change the text size/color for one specific textbutton? Is there a property for that?
"Don't Explode!"
-me
-me
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Creating a tooltip/Increasing textbutton text size
You could give it a class and then style that class.
Personally, I'd recommend going with an imagebutton if it suits. You get far more customisation overall and it looks better, but isn't always the best way to approach things.
Personally, I'd recommend going with an imagebutton if it suits. You get far more customisation overall and it looks better, but isn't always the best way to approach things.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Creating a tooltip/Increasing textbutton text size
To change size and colour for one specific textbutton:
You can use pretty much anything from Text Style Properties with "text_" prefix in front.
Code: Select all
textbutton _("Button Name"):
action Start()
text_size 50
text_color "#FF0000"
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], minyan
