Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Sslaxx on Wed 10/11/2010 14:27:36

Title: Iterating through GUIs to set them not visible.
Post by: Sslaxx on Wed 10/11/2010 14:27:36
I'm wondering if there's an easy way of iterating through GUIs and setting them all to be not visible (otherwise I can theoretically have save and load dialogues be enabled at the same time, for example).
Title: Re: Iterating through GUIs to set them not visible.
Post by: barefoot on Wed 10/11/2010 14:35:23
Hi

do you mean something like this? The folllowing is something i have:


gSymbols.Visible = false;
gNotes.Visible = false;
gClose.Visible = false;
gRun.Visible = false;
gWalk.Visible = false;
gInv.Visible = false;
gsave.Visible = false;
gGui4.Visible = true;
gload.Visible = true;
gIconbar2.Visible = false;


barefoot
Title: Re: Iterating through GUIs to set them not visible.
Post by: Calin Leafshade on Wed 10/11/2010 14:37:46
i think there is a Gui array somewhere.

something like Game.Guis[]

EDIT: No wait its a global array.

so you can just do


int i = 0;
while (i < Game.GuiCount){

gui[i].Visibile = false
}
Title: Re: Iterating through GUIs to set them not visible.
Post by: Sslaxx on Wed 10/11/2010 14:46:47
Ah, case sensitivity strikes again (was using GUI instead, doh). Cheers, Calin!
Title: Re: Iterating through GUIs to set them not visible.
Post by: monkey0506 on Thu 11/11/2010 03:41:27
Just to be completely clear, GUI (all caps) refers to the type whereas gui (all lower-case) refers to the global array of instances of the GUI type.