[Solved]Hover one choice, dim other?
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.
- G0RG3h
- Newbie
- Posts: 17
- Joined: Tue Nov 02, 2021 8:59 am
- Projects: Circle Head
- itch: g0rg3h
- Contact:
[Solved]Hover one choice, dim other?
Hello, how can I make it so that when you hover over one choice item, the other will darken? I'm not sure where to start on attempting it myself so I can't share any code of my own. Thank you!
Last edited by G0RG3h on Sat Nov 20, 2021 7:52 pm, edited 1 time in total.
<<<<damn you len>>>>>
Re: Hover one choice, dim other?
It's easier to brighten the choice you're currently hovering, if that works for you. Make the default image the dimmer version, and do:
Code: Select all
imagebutton:
xysize 256,256
idle dimmer_img
hover brighter_img
action ShowMenu("lore_entry", entry)
colin r
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM
➔ if you're an artist and need a bit of help coding your game, feel free to send me a PM
- G0RG3h
- Newbie
- Posts: 17
- Joined: Tue Nov 02, 2021 8:59 am
- Projects: Circle Head
- itch: g0rg3h
- Contact:
Re: Hover one choice, dim other?
You're right, actually! Not sure why i thought that that qould be something to do when i could just do it manually. Thank you!
EDIT: Leaving this unsolved for anyone who would in the future like to show an actual way to do this. Thank you if you do, still!
EDIT: Leaving this unsolved for anyone who would in the future like to show an actual way to do this. Thank you if you do, still!
<<<<damn you len>>>>>
Re: Hover one choice, dim other?
Not sure if this is best way to do it, but why not
Idea is set tooltip to buttons along with transform, in this transform we call function which check which tooltip is currently set and darken concurrent buttons.
But usually idle/hover imagebutton states should be good looking enough.
Code: Select all
init python:
class button_effect_fn(object):
def __init__(self,tt_id):
super(button_effect_fn,self).__init__()
self.tt_id=tt_id
def __call__(self,tf,st,at):
tt=GetTooltip()
if tt==self.tt_id:
tf.matrixcolor=BrightnessMatrix(0.0)
elif isinstance(tt,basestring) and tt.startswith("{#btn_"):
tf.matrixcolor=BrightnessMatrix(-0.25)
else:
tf.matrixcolor=None
return 0
transform tf_button_effect(tt_id):
function button_effect_fn(tt_id)
screen test():
vbox:
align (0.5,0.5)
for n in range(0,5):
$btn_id="{#btn_"+str(n)+"}"
textbutton "Button #[n]":
at tf_button_effect(btn_id)
tooltip btn_id
action NullAction()
label start:
show screen test
"test"
return
But usually idle/hover imagebutton states should be good looking enough.
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350
- G0RG3h
- Newbie
- Posts: 17
- Joined: Tue Nov 02, 2021 8:59 am
- Projects: Circle Head
- itch: g0rg3h
- Contact:
Re: Hover one choice, dim other?
Thank you for the help! I just ended up making the buttons dim on default, enlarged the hover button and made it lighter, and made the font text bigger on hover and I got the illusion I wanted. Made it hard for myself for no reason, Haha!
For any novices not sure how to change hover text size (like me), I just added this line in the choice button gui section. Easy as pie.
For any novices not sure how to change hover text size (like me), I just added this line in the choice button gui section. Easy as pie.
Code: Select all
define gui.choice_button_text_hover_size = 35
<<<<damn you len>>>>>
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot]