Panel

Posted By: bjarni

Panel - 09/19/10 22:49

I need fundamental understanding of panel

I need to set flag = SHOW later when panel already defined?.

and how to insert button in panel when created this way?.

function call_MainMenu()
{
PANEL* MainMenu = pan_create("flags=SHOW",999); //create a panel at 0,0 at runtime
BMAP* bmpMainMenu = "mainmenu.pcx"; //Set the bitmap

MainMenu.bmap = bmpMainMenu; // NOW add the bmap to the Panel
MainMenu.pos_x = (screen_size.x - bmap_width(bmpMainMenu)) / 2;

MainMenu.pos_y = 50;
// Need buttons here
}
Posted By: Roy

Re: Panel - 09/20/10 21:01

For inserting buttons, take a look at the pan_setbutton command (in the manual)

I don't think you need to set flag=SHOW later; you can just set it directly, as you do now.

I don't know if you want to do this, but additionally, you can also set other settings (such as the bmap) instantly at creation:
PANEL* MainMenu = pan_create("bmap = bmpMainMenu.pcx; flags = SHOW;", 999);
Posted By: bjarni

Re: Panel - 09/21/10 12:56

Hi Roy and thx, thought this topic was dead.

But yes if iam showing video/intro and after want to Show panel(mainMenu) i could change flag to flag=SHOW or something when intro is done. Maybe its me that are thinking Object Oriented. Like

Main
{ // Here 2 panels and changing visible states
SplashScreen.Show = true;

Wait(-10);

SplashScreen.Dispose();

MainMenu.Show = true;
}

and i will look into pan_setbutton command (in the manual) to night.
Posted By: 3dgs_snake

Re: Panel - 09/21/10 13:27

With Lite-C, you can do :

function main()
{ // Here 2 panels and changing visible states
set(SplashScreen,SHOW); // or SplashScreen.flags |= SHOW ;

wait(-10);

reset(SplashScreen,SHOW); // or SplashScreen.flags &= ~SHOW ;
// or toggle( SplashScreen, SHOW) ;

// And finally
set(MainMenu,SHOW); // or MainMenu.flags |= SHOW ;
// or also toggle(MainMenu,SHOW); if mainmenu was not visible
}

regards.
Posted By: bjarni

Re: Panel - 09/21/10 17:19

3dgs_snake ,,very nice exactly what i needed. Have to throw me over the functions library.
© 2024 lite-C Forums