Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Eleri on Mon 30/05/2011 17:21:52

Title: showing something on/off
Post by: Eleri on Mon 30/05/2011 17:21:52
Okie, so I have puzzle where certain buttons need to be pushed. I have the graphic with the buttons in their off state, I was assuming that to make the on state be noticeable, I need to make an object for each button, overlay it, and then have the hotspot toggle the object on/off.

That's the right way to do it? Or am I missing something that'll make it much easier?
Title: Re: showing something on/off
Post by: TheRoger on Mon 30/05/2011 17:33:12
That is how I'd do it, so I guess it's right. Also add code for object, if you want turn off it later.
Title: Re: showing something on/off
Post by: Khris on Mon 30/05/2011 18:51:49
You can skip the hotspots; instead of turning the object on/off, change its .Graphic.

Example:
Button on sprite: 32
Button off sprite: 33

oButton1_Interact() {
  oButton1.Graphic = 65 - oButton1.Graphic;
}[code]
[/code]