Iterating through GUIs to set them not visible.

Started by Sslaxx, Wed 10/11/2010 14:27:36

Previous topic - Next topic

Sslaxx

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).
Stuart "Sslaxx" Moore.

barefoot

Hi

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

Code: ags

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
I May Not Be Perfect but I Have A Big Heart ..

Calin Leafshade

#2
i think there is a Gui array somewhere.

something like Game.Guis[]

EDIT: No wait its a global array.

so you can just do

Code: ags

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

gui[i].Visibile = false
}

Sslaxx

Ah, case sensitivity strikes again (was using GUI instead, doh). Cheers, Calin!
Stuart "Sslaxx" Moore.

monkey0506

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.

SMF spam blocked by CleanTalk