if (key_t) to open menu?

Posted By: JakeBilbe

if (key_t) to open menu? - 06/05/11 00:51

I want an in game menu to be accessible by pressing t I have set the code and everything but it wont show up, I get no syntax errors so here is the panel code and the function statement I am using in the main.c script not the player.c:

Code:
PANEL* main_pan =
{
  bmap = "main.png";
  pos_x = 250;     
  pos_y = 200;    
  }

function escape_menu()
{
if (key_t)
set (main_pan, OVERLAY | SHOW);	
}


Posted By: MrGuest

Re: if (key_t) to open menu? - 06/05/11 01:10

where exactly do you call escape_menu? try
Code:
PANEL* main_pan = {
  bmap = "main.png";
  pos_x = 250;     
  pos_y = 200;
  flags = OVERLAY;
}

void escape_menu(){
  set(main_pan, SHOW);
}

void main(){
  on_t = escape_menu;
}


Posted By: JakeBilbe

Re: if (key_t) to open menu? - 06/05/11 01:25

I have no idea, I am still halfway through the workshops. I just assumed a function would be loaded and executed the same way my function main_player() is. I replaced my code with yours but it doesn't show still. I am basically making a player menu that appears when you press T showing different icons and instructions but it wont appear.
Posted By: MrGuest

Re: if (key_t) to open menu? - 06/05/11 21:40

You'd probably find it easier to finish the workshops then start again trying to rewrite your code in lite-c
© 2024 lite-C Forums