Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Cheerios on Sun 14/12/2008 17:43:11

Title: Change GUI background Graphic - syntax (solved)
Post by: Cheerios on Sun 14/12/2008 17:43:11
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:
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:
5 gMyGUI.BackgroundGraphic;
gMyGUI.BackgroundGraphic = 5;
(5)gMyGUI.BackgroundGraphic;
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
Title: Re: Change GUI background Graphic - syntax
Post by: Trent R on Sun 14/12/2008 19:02:05
Should be "gMyGUI.BackgroundGraphic = 5;"

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



~Trent
Title: Re: Change GUI background Graphic - syntax
Post by: Dualnames on Sun 14/12/2008 20:39:54
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.
Title: Re: Change GUI background Graphic - syntax
Post by: 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
Title: Re: Change GUI background Graphic - syntax
Post by: Dualnames on Mon 15/12/2008 20:31:05
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.