Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: LeChuck on Tue 01/02/2005 23:24:06

Title: Turning off Objects within a GUI? [SOLVED]
Post by: LeChuck on Tue 01/02/2005 23:24:06
I'm in the middle of creating an icon-based dialog system similar to the one in Sam and Max... I'm wondering, is there a way of manipulating Objects / Buttons within a GUI? For example, when the user has clicked an icon and it runs a dialog, I want some buttons to just disappear afterwards.

Please tell me I don't have to use several GUI's to accomplish this...
Title: Re: Turning off Objects within a GUI?
Post by: on Wed 02/02/2005 03:15:53
Hmm... Perhaps you could try SetGUIObjectEnabled. Combine this with a "SetButtonPic(YOURGUI, BUTTONNUMBER, 1, 0)" and the button will become disabled, and "turn off".  ;)

BTW, (I believe) you're new, so welcome to the forums! ;D
Title: Re: Turning off Objects within a GUI?
Post by: on Wed 02/02/2005 03:17:40
Hmm... Not a new member, but only 17 posts... Ã, :P
Title: Re: Turning off Objects within a GUI?
Post by: Goot on Wed 02/02/2005 05:13:43
QuoteSetButtonPic(YOURGUI, BUTTONNUMBER, 1, 0)
Are you sure this won't set the picture to a blue cup? If it does, there's a command (SetGUIObjectPosition?) which sets the coordinates of a GUI object, so you can move it somewhere off the screen when you're done with it.
Title: Re: Turning off Objects within a GUI?
Post by: LeChuck on Wed 02/02/2005 21:27:43
Quote from: Goot on Wed 02/02/2005 05:13:43
QuoteSetButtonPic(YOURGUI, BUTTONNUMBER, 1, 0)
Are you sure this won't set the picture to a blue cup? If it does, there's a command (SetGUIObjectPosition?) which sets the coordinates of a GUI object, so you can move it somewhere off the screen when you're done with it.

I didn't try the other thing as I really didn't understand it or even look into it, but this worked perfectly. Thanks.
Title: Re: Turning off Objects within a GUI?
Post by: on Sat 05/02/2005 02:28:17
Quote from: Goot on Wed 02/02/2005 05:13:43
QuoteSetButtonPic(YOURGUI, BUTTONNUMBER, 1, 0)
Are you sure this won't set the picture to a blue cup? If it does, there's a command (SetGUIObjectPosition?) which sets the coordinates of a GUI object, so you can move it somewhere off the screen when you're done with it.

Well it depends on the sprite in slot 0.  I believe the default (for the latest versions of AGS) is an empty sprite.  Alternately you could import an empty sprite and use that sprite number in place of 0, which seems to make more sense than setting it to a location that is out of the screen's parameters...