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.
screen GenCodeInput:
tag puzzle
use navigation
imagemap:
ground "gencode.png"
idle "gencode.png"
hover "gencodehover.png"
hbox:
for i in (0,9):
textbutton str(i):
if code==0:
code=i
elif code<10:
code= 10*code + i
elif code>9999:
codestring=str(code)
for ch in codestring:
codestring2 = str(codestring[-4:])
code = int(codestring2)
code = 10*code + i
ground "gencode(%code).png"
textbutton clear:
code=0
The problem is that this requires 10000 images, one for each possible number, which simply isn't feasible. Is there some way I can do this more efficiently?