screen.resolution.set (512,384)
@icon=icon.load ("avo\dinosaur.png")
icon.persistence.set (@icon,TRUE)
icon.display (@icon,240,140)
screen.set (BACK)
pattern.display ("avo\bubble.gif")
screen.end ()
@button=button.load ("avo\button_01.btn")
button.display (@button,256+20,CENTER,Event.Manager,PRESS_LEFT_BUTTON)
text.display ("Click on the button to swap the layers. Press ESCAPE to exit.",CENTER,350)
keyboard.wait (KEY_ESCAPE)
script.stop ()
procedure Event.Manager (@event,%status)
if (%flag)
button.layer.set (@event,256)
else ()
button.layer.set (@event,1)
endif()
%flag^=TRUE
%data=button.layer.get (@event)
text.display (" The layer of the button is : " + STR (%data)+" ",CENTER,10)
end procedure