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.
define boardsize = [5,8]
define showcoordinates = False
screen Gameboard():
fixed:
xpos 300 ypos 400
for y in range(boardsize[0]):
for x in range(boardsize[1]):
fixed:
xysize (200, 100)
xoffset ((x * 163) + (y * -30))
yoffset (y * 100)
add "tile.png" xalign 0.0 yalign 0.0
imagebutton:
idle "tile"
hover "tile-select"
action Notify(_("You clicked tile [x], [y]"))
#How do I make the line above use the variables of x and y at the time of creation?
Last edited by Chekhov on Fri Sep 13, 2019 4:59 pm, edited 1 time in total.
define boardsize = [5,8]
define showcoordinates = False
screen Gameboard():
fixed:
xpos 300 ypos 400
for y in range(boardsize[0]):
for x in range(boardsize[1]):
fixed:
xysize (200, 100)
xoffset ((x * 163) + (y * -30))
yoffset (y * 100)
add "tile.png" xalign 0.0 yalign 0.0
imagebutton:
idle "tile"
hover "tile-select"
action Notify(_("You clicked tile [x], [y]"))
#How do I make the line above use the variables of x and y at the time of creation?
You can interpolate just like what you did or use format() function to make it less messy.
define boardsize = [5,8]
define showcoordinates = False
screen Gameboard():
fixed:
xpos 300 ypos 400
for y in range(boardsize[0]):
for x in range(boardsize[1]):
fixed:
xysize (200, 100)
xoffset ((x * 163) + (y * -30))
yoffset (y * 100)
add "tile.png" xalign 0.0 yalign 0.0
imagebutton:
idle "tile"
hover "tile-select"
action Notify(_("You clicked tile [x], [y]"))
#How do I make the line above use the variables of x and y at the time of creation?
You can interpolate just like what you did or use format() function to make it less messy.