Hi, this is probably a really basic question, but I've been wanting to change the button text colour when someone hovers the mouse over it, but haven't been able to work out how.
I can change the button colour, but not the text colour.
Essentially, I want to remove the 'button' all together and just have the text there. When someone puts their mouse on it, the colour should change.
Thanks you!
Button Text Hover Color
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.
-
- Newbie
- Posts: 4
- Joined: Wed Aug 20, 2014 7:27 am
- Contact:
- fluxus
- Regular
- Posts: 133
- Joined: Thu Jun 19, 2014 8:06 am
- Projects: Animal Anaesthesia (a teaching game)
- Contact:
Re: Button Text Hover Color
Couldn't you change text_style with the actions run on hovered/unhovered?
(assuming the use of textbutton)
(assuming the use of textbutton)
-
- Newbie
- Posts: 4
- Joined: Wed Aug 20, 2014 7:27 am
- Contact:
Re: Button Text Hover Color
I've tried that, but was unsuccessful. I'm not too good with coding, so I really don't know what I'm doing.
Is there anyway of achieving this with the regular button?
Thanks!
Is there anyway of achieving this with the regular button?
Thanks!
Re: Button Text Hover Color
As fluxus said, you should simply use styles. set background to Null() if you just want the text and use hover/idle prefixes to specify colors.
-
- Newbie
- Posts: 4
- Joined: Wed Aug 20, 2014 7:27 am
- Contact:
Re: Button Text Hover Color
Okay, I'll try doing that again.
Would it be possible for someone to post a code snippet example please?
As I said, I'm not great with coding and I'm even less experienced with python (I have done a little VB)), so im really just working by trial and error at the moment.
Would it be possible for someone to post a code snippet example please?
As I said, I'm not great with coding and I'm even less experienced with python (I have done a little VB)), so im really just working by trial and error at the moment.
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Button Text Hover Color
Code: Select all
label start:
show screen test
pause
return
screen test:
vbox:
style_group "test"
textbutton "Hover Me" action NullAction()
style test_button:
background None
style test_button_text:
color "#FFF"
hover_color "#000"
-
- Newbie
- Posts: 4
- Joined: Wed Aug 20, 2014 7:27 am
- Contact:
Re: Button Text Hover Color
Thanks so much!
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Ocelot