Change GUI background Graphic - syntax (solved)

Started by Cheerios, Sun 14/12/2008 17:43:11

Previous topic - Next topic

Cheerios

I’m trying to change the background graphic of my GUI when a certain event happens.  However, I’m having trouble with the syntax on how to write this.
In the manuel, I’ve found the BackgroundGraphic property (GUI)  which suggests:
Code: ags
 int GUI.BackgroundGraphic 

However, when I try this and any variation that I can think of, I get an error.  This is what I have tried:
Code: ags
5 gMyGUI.BackgroundGraphic; 

Code: ags
gMyGUI.BackgroundGraphic = 5; 

Code: ags
(5)gMyGUI.BackgroundGraphic; 

Code: ags
gMyGUI.BackgroundGraphic(5); 

If someone could help me with the proper syntax I'd really appreciate it.  Oh, and I'm uising version 3.1.1
Thanks,
Cheerios

Trent R

Should be "gMyGUI.BackgroundGraphic = 5;"

What is the error you are getting and where have you written the line?



~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Dualnames

Cheerios the function you need to change a GUI's background graphic is this:
gMyGui.BackgroundGraphic=5; as TrentR also noted. There are two things:

Is there a GUI named gMyGUI?
Have you tried placing
gMyGui.BackgroundGraphic=5;
somewhere else to see if it's working? I usually do place inside a hotspot's interaction, that I know its working.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Cheerios

Thank you Trent and Dualnames for the tips.
Confirming that the syntax was actually correct, allowed me to search elseware to find the REAL problem.  I followed your advice, Dualnames, and moved the code elseware to see if it would work â€" it did!  Bottom line â€" there was different HIDDEN problem, that I was able to find and fix, thanks to your support.
Thanks,
Cheerios

Dualnames

Quote from: Cheerios on Mon 15/12/2008 14:12:53
Thank you Trent and Dualnames for the tips.
Confirming that the syntax was actually correct, allowed me to search elseware to find the REAL problem.  I followed your advice, Dualnames, and moved the code elseware to see if it would work â€" it did!  Bottom line â€" there was different HIDDEN problem, that I was able to find and fix, thanks to your support.
Thanks,
Cheerios


Ok, glad you got it right.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk