Changing GUI from inside a program

Started by Outcast, Tue 03/01/2017 21:16:10

Previous topic - Next topic

Outcast

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
 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:

Crimson Wizard

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.

Khris

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.

Outcast

Thank you both sincerely.
Seems like I'm always looking in the wrong sections of the manual.

SMF spam blocked by CleanTalk