Show and hide panel on key click

Posted By: Darkyyes

Show and hide panel on key click - 02/05/09 22:50

Show and hide panel on key click
how to make a toogle function to show and hide a panel on lets say the key k,

//main inventory
PANEL* test_panel =
{
bmap = test_panel;
layer = 0;
flags = SHOW;
}
Posted By: Quad

Re: Show and hide panel on key click - 02/05/09 22:54

Code:
function toogle_the_panel(){
  toggle(test_panel,SHOW);
}


or

Code:
function toogle_the_panel(){
  if(is(test_panel,SHOW))
  {
     reset(test_panel,SHOW);
  }
  else{
     set(test_panel,SHOW); 
  }
}


and in your main fucniton before the while:

on_k = toggle_the_panel;

OR

in your main while

if(key_k) toggle_the_panel();
Posted By: Darkyyes

Re: Show and hide panel on key click - 02/05/09 23:20

Thank you very much smile
© 2023 lite-C Forums