Using imagebutton to return variables?
Posted: Sat May 08, 2021 3:17 am
I'm trying to make a character creation feature, where you have X points to allocate, you click icons corresponding to str, int, etc, and when clicked, subtract a point and add one to whatevever attribute that was clicked.
Here's a simplified example:
But how to specify the XXXX to be whatever was clicked...? Or is this completely the wrong approach?
Here's a simplified example:
Code: Select all
screen chargen
imagebutton auto "str_%s.png":
xpos 200 ypos 200
action Return("str"), Jump("buttonclicked")
Code: Select all
$ points = 10
$ str = 3
label chargen:
show screen chargen
while points > 0:
"you have [points] points left to allocate"
jump character_creation_done
label buttonclicked:
$ XXXX += 1
"added 1 to XXXX"
$ points -= 1
jump chargen