Is there a simple way for me to have the hover state remain on? Preferably, I'd like to keep the hover state up for a dialogue screen or two, and then reset it, but I can work around keeping it on for the duration of the puzzle. I know about a "_selected_idle" extension in the Ren'py documentation that appears to be what I'm looking for, but I'm unsure how to implement it?
Otherwise, I could probably set variables and if statements for each clickable, like I treat the candle in the code example below, but I'm sure there must be a quicker, easier way to do it. I have a few areas like this in my game where I'll be using code like this, so I'll be applying this lesson a few times.
Code for the screen:
Code: Select all
screen p2_puzzle_basement:
imagebutton auto "p2_basement/bride_%s.png" xpos 840 ypos 140 focus_mask True action If(propsEnabled, Return ("bride"))
imagebutton auto "p2_basement/candy_%s.png" xpos 0 ypos 300 focus_mask True action If(propsEnabled, Return ("candy"))
imagebutton auto "p2_basement/door_%s.png" xpos 1320 ypos 45 xanchor 1.0 focus_mask True action If(propsEnabled, Return ("door"))
imagebutton auto "p2_basement/rip_%s.png" xpos 980 ypos 290 focus_mask True action If(propsEnabled, Return ("rip"))
imagebutton auto "p2_basement/skull_%s.png" xpos 620 ypos 60 focus_mask True action If(propsEnabled, Return ("skull"))
imagebutton auto "p2_basement/snake_%s.png" xpos 390 ypos 145 focus_mask True action If(propsEnabled, Return ("snake"))
imagebutton auto "p2_basement/soup_%s.png" xpos 600 ypos -2 xanchor 1.0 focus_mask True action If(propsEnabled, Return ("soup"))
imagebutton auto "p2_basement/lights_%s.png" xpos 0 ypos 0 focus_mask True action If(propsEnabled, Return ("lights"))
# We only want to display the key if the player has not collected it yet.
if keyCollected == False:
image "karah anger.png" ypos 165 xpos 140 zoom 0.75
imagebutton auto "p2_basement/candle_%s.png" xpos 1000 ypos 10 focus_mask True action If(propsEnabled, Return ("key"))
else:
add "p2_basement/candlepressed.png" xpos 1000 ypos 10
imagebutton auto "p2_basement/hole_%s.png" xpos 300 ypos 485 focus_mask True action If(propsEnabled, Return ("hole"))
image "karah smile.png" ypos 165 xpos 50 zoom 0.75
Code: Select all
while True:
$ propsEnabled = True
call screen p2_puzzle_basement
$ propsEnabled = False
show screen p2_puzzle_basement
show screen textbox_overlay
if _return == "key":
$ keyCollected = True
show screen p2_puzzle_basement
show screen textbox_overlay
k "Okay, gateway to a dark dimension. That's progress."
elif _return == "candy":
show screen p2_puzzle_basement
show screen textbox_overlay
k "Bram always gives out the best candy on Halloween."
ETC., ETC.,
elif _return == "hole":
jump p2_basement_splitpath