When the textbutton is hovered, you can press the enter key and it will trigger its action.
But how can you make it so enter key triggers selected state, but without overriding Ren'py's control of the select key; that means I don't want to use KEY, because that will create extra work)?
Code: Select all
default listOfButtonIndex = 0
init python:
def incIt():
global listOfButtonIndex
listOfButtonIndex += 1
print listOfButtonIndex
def decIt():
global listOfButtonIndex
listOfButtonIndex -= 1
print listOfButtonIndex
screen listOfButtons():
key "w" action Function(decIt)
key "s" action Function(incIt)
vbox:
for i in range(0, 10):
textbutton str(i):
xpos 200
ypos 200
style "some_style12"
text_style "some_style12"
#action [SetVariable("listOfButtonIndex", i), Show('test214')]
action [SelectedIf(SetVariable("listOfButtonIndex", i)), SetVariable("listOfButtonIndex", i), Show('test214') ]
style some_style12:
idle_color "#555555"
hover_color "#FF0000"
selected_color "#1fff00"
screen test214():
text "test"
screen waitit():
pass
label start:
show screen listOfButtons
call screen waitit
jump start
return