I'm trying to have a screen with buttons on it, but I don't want to use an image map as I want the buttons to only appear if the right conditions are met.
I have a couple if images defined at the start, but not in an init block and before the start label
Code: Select all
image bg yourRoom = "bedroom.jpg"
image bg yourComp = "computer.jpg"
Code: Select all
screen yourRoom():
window:
pos(0,0)
anchor ('top','left')
xysize(1024,768)
xpadding 0
ypadding 0
background None
# background Frame("bedroom.jpg")
vbox:
button:
pos(600,350)
text "computer"
background None
#action useYourComputer
Code: Select all
label useYourComputer:
scene bg yourComp
you "This is my computer"
Code: Select all
you "Ah! A brand new day. I wonder what crazy shenanigans I'll get up to this time."
show screen yourRoom
you "This is my room"
As it is right now, the screen yourRoom just makes the word "computer" appear in the middle of the screen.
If I uncomment the buttons action, I get the error: name 'useYourComputer' is not defined
It's not a problem with the labels visibility as it works fine if I jump to it from the script file.
It's not an execution order problem either as if I put the screens in an init block, it still happens.
Also, how do use the background element for anything other than making it invisible?
if I use: background Frame("bedroom.jpg")
in the screen yourRoom
I get the error:
error in script
you "This is my room"
TypeError: unsupported opperand type(s) for +: 'NoneType' and 'NoneType'