Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Outcast on Tue 03/01/2017 21:16:10

Title: Changing GUI from inside a program
Post by: Outcast on Tue 03/01/2017 21:16:10
Hello peoples! Here's the latest situation.

I'm trying to create one GUI panel that has many (20+) possible pictures, to do this I tried using
Code (ags) Select
gExamineIcon.BackgroundGraphic = Picture;
The name of the GUI button is gExamineIcon and 'Picture' is the variable number of the sprite.

What happens is the computer displays the error: BackgroundGraphic is not a public member of 'Button'. Check spelling.

Please help. I think Roger is laughing at me. :cheesy:
Title: Re: Changing GUI from inside a program
Post by: Crimson Wizard on Tue 03/01/2017 21:22:21
The list of Button members can be seen in the manual:

http://www.adventuregamestudio.co.uk/wiki/GUI_Button_functions_and_properties

You probably need Button.NormalGraphic.
Title: Re: Changing GUI from inside a program
Post by: Khris on Wed 04/01/2017 01:21:47
You should stick to the convention and use "gName" for GUIs and "bName" or "btnName" for buttons.
Plus, when you type "gExamineIcon", then the dot, the auto-complete window will pop up and show the available functions and properties. Typing one that isn't in there without realizing it is basically impossible.
Title: Re: Changing GUI from inside a program
Post by: Outcast on Wed 04/01/2017 18:53:10
Thank you both sincerely.
Seems like I'm always looking in the wrong sections of the manual.