Hide many panels with one key

Posted By: vargur

Hide many panels with one key - 02/16/09 23:08

Hi i have many panels each contained in a single wdl-file is it possible to assign one key to all of this panels to show or hide them? If it is possible how do I do that
Posted By: Darkyyes

Re: Hide many panels with one key - 02/16/09 23:22

make a toggle function for each of them
then in your player script or main.wdl
on_i = toggle_nameoftogglefunction;

or if you mean hide all the panels on one key
just put every panel in one toggle function
on_i = toggle_nameoftogglefunction;

lite-c example
Code:
function toggle_panel()
{
      if is ("insert name of panel here", VISIBLE)
      {
      reset("insert name of panel here", VISIBLE);
      }
      else
      {
      set("insert name of panel here", VISIBLE);
      }
}

without quotation marks


just add more lines with reset and set like this

Code:
function toggle_panel()
{
      if is ("insertnameofpanelhere", VISIBLE)
      {
      reset("insertnameofpanelhere", VISIBLE);
      reset("insertnameofpanelhere", VISIBLE);
      reset("insertnameofpanelhere", VISIBLE);
      reset("insertnameofpanelhere", VISIBLE);
      }
      else
      {
      set("insertnameofpanelhere", VISIBLE);
      set("insertnameofpanelhere", VISIBLE);
      set("insertnameofpanelhere", VISIBLE);
      set("insertnameofpanelhere", VISIBLE);
      }
}


dont know if this example will work directly with wdl/c-script
perhaps some function is named differtly but the basic idea is there wink
also the hide multiple panel example i gave will only check if one of the panel is showing, but it would not matter in that case and easily changeable wink
I dont know c-script in anyway frown
Posted By: vargur

Re: Hide many panels with one key - 02/16/09 23:28

Wow this was a very fast reply I am impressed. Thank you very much I will try it that way
Posted By: Darkyyes

Re: Hide many panels with one key - 02/16/09 23:38

I try staying on when I am at home smile
hope it works that or we might find a way wink
Posted By: vargur

Re: Hide many panels with one key - 02/16/09 23:50

tried it this way

function toggle_pan()
{
while(key_v == on)
{
wait(1);
}
"insert name of panel here".visible = ("insert name of panel here".visible == off);
"insert name of panel here".visible = ("insert name of panel here".visible == off);
"insert name of panel here".visible = ("insert name of panel here".visible == off);
"insert name of panel here".visible = ("insert name of panel here".visible == off);
}

}
on_v = toggle_pan;


and it works just perfect thank u so much
Posted By: Darkyyes

Re: Hide many panels with one key - 02/16/09 23:51

your welcome. smile trying to learn gamestudio myself. smile and I have found looking at filled examples really helps me atleast. smile
Be sure to ask on the forum, look in the aum, look at other topics. some topics may not look like its what you look for but sometimes it is. smile This community has helped me a ton. smile
Glad I could be of help. smile
Posted By: vargur

Re: Hide many panels with one key - 02/16/09 23:58

I sent you a pm with a further question maybe if u don't mind u could help me with that too
Posted By: Darkyyes

Re: Hide many panels with one key - 02/17/09 00:07

Sure. I will take a look.
© 2023 lite-C Forums