Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Hello
I want to print a list as days in a viewport
I have a problem with printing the list, basically it has problem with indices I don't know how to fix. In python shell it works when I use i but not in ren'py.
(List indices must be integers, not unicode)
default my_list = ["one", "two", "three"]
screen list_scr():
vbox:
align(0.2, 0.1)
for i in range(0, len(my_list)):
text "%s" % my_list[i]
vbox:
align(0.4, 0.1)
for i in my_list:
text"[i]"
label start:
scene black
"..."
show screen list_scr
"?"
solved the problem. Also is there any way to add to the text like textbutton a hover action to show an image? For example with your list, when I would hover over a 1 it would show a image on x,y pos on the screen. Simply adding a hovered with image to a textbutton makes it unresponsive
Work very well. I just meant that your code didn't use my viewport originally but I got it already working in viewport. Just one last thing what is that action you used in list_scr. And thank you so much.
So, if you don't have an actual action for the button you can use NullAction() or an empty list of action [[]]
('cause you can set a list of actions for the button, like)