splashscreen problem??!

Posted By: carla_mariz

splashscreen problem??! - 01/05/11 01:52

i'm creating a splashscreen for my game and my problem is after showing the splash screen, the buttons for the menu won't work. even the mouse over or click.

here is the code:
Code:
BMAP* splashmap = "SPLASH.jpg";
BMAP* men1 = "ITEMMENU.jpg";

/////////////////////////////////////////////////////////////////
PANEL* splashscreen =
{
	bmap = splashmap;
	flags = OVERLAY | SHOW;
}

PANEL* logoscreen =
{
	layer = 2;
 	bmap = men1;
 	pos_x = 0;     
 	pos_y = 0; 
 	button (110, 180, "singleot.tga", "singleot.tga", "singleov.tga", NULL, NULL, overmenuitem);      
 	button (410, 180, "lanot.tga", "lanot.tga", "lanov.tga", NULL, NULL, overmenuitem);      
 	button (20, 260, "optot.tga", "optot.tga", "optov.tga", NULL, NULL, overmenuitem);      
 	button (530, 260, "insot.tga", "insot.tga", "insov.tga", NULL, NULL, overmenuitem);      
 	button (50, 340, "abot.tga", "abot.tga", "abov.tga", NULL, NULL, overmenuitem);      
 	button (490, 340, "exot.tga", "exot.tga", "exov.tga", NULL, NULL, overmenuitem);   
	flags = OVERLAY | SHOW;
}


//////////////////
function main()
{

	freeze_mode = 1;
	screen_size.x = 800;
        screen_size.y = 600;
	mouse_mode = 0;
	wait(3);
	logoscreen.flags &= ~SHOW;
   
	splashscreen.pos_x = (screen_size.x - bmap_width(splashmap)) / 2; 
	splashscreen.pos_y = (screen_size.y - bmap_height(splashmap)) / 2;
	splashscreen.flags = UNTOUCHABLE | SHOW;

	splashscreen.alpha =100;
	wait(-2);
	
	while (splashscreen.alpha >= 0)
		{
		  splashscreen.alpha -= 2*time_step; 
		  wait(1);
		}
        freeze_mode = 0;
	splashscreen.flags &= ~SHOW; 
	bmap_purge(splashmap); 
	
	logoscreen.flags = SHOW | OVERLAY;
	 
}



my another question, is there a way on how to make fade in and out for the splash???


pls help me..thanks a lot! ^_^
Posted By: xbox

Re: splashscreen problem??! - 01/05/11 02:27

Well, one way to fade in and out the splash screen would be to
1) display a black fullscreen panel.
2) fade the splash screen in overtop of it.
3) fade the splash screen out.
4) turn off the black fullscreen panel.

after freeze_mode = 0, shouldn't mouse_mode = 1 ?????
Posted By: codeChallenged

Re: splashscreen problem??! - 01/06/11 23:06

This splash code alphas a panel & plays a comment during the game:

function key_one() //splashpanel
{
// calling routine has a wait of 2 sec.

K1_panel.flags = UNTOUCHABLE | SHOW | TRANSLUCENT;

K1_panel.alpha = 0;

// Play sound "file"
mhandle = media_play("key_one1.mp3",NULL,100);


while (K1_panel.alpha <=100)
{
K1_panel.alpha += 2*time_step;
wait(1);
}

if (K1_panel.alpha >= 100)
{
wait (-10);
K1_panel.flags &= ~SHOW;
}

}

note the panel must be translucent, and the alpha now counts up from zero not down to 0. You don't need a freeze_mode to show a panel, that might be affecting your logopanel.
Posted By: carla_mariz

Re: splashscreen problem??! - 01/07/11 01:41

@codeChallenged, it turned into black. it shows nothing. frown
Code:
function splashout();

PANEL* splash1_panel =    //splash panel
{
	layer = 3;
	bmap = "SPLASH.JPG";
	pos_x = 0;
	pos_y = 0;
}


PANEL* logoscreen =   //main menu
{
	layer = 2;
 	bmap = men1;
 	pos_x = 0;     
 	pos_y = 0; 
 	button (110, 180, "singleot.tga", "singleot.tga", "singleov.tga", NULL, NULL, overmenuitem);      
 	button (410, 180, "lanot.tga", "lanot.tga", "lanov.tga", NULL, NULL, overmenuitem);      
 	button (20, 260, "optot.tga", "optot.tga", "optov.tga", options, NULL, overmenuitem);      
 	button (530, 260, "insot.tga", "insot.tga", "insov.tga", instruct, NULL, overmenuitem);      
 	button (50, 340, "abot.tga", "abot.tga", "abov.tga", NULL, NULL, overmenuitem);      
 	button (490, 340, "exot.tga", "exot.tga", "exov.tga", is_exit_prg, NULL, overmenuitem);   
	flags = SHOW | OVERLAY; 
}


function splashout()
{
	splash1_panel.flags = UNTOUCHABLE | SHOW | TRANSLUCENT;
	splash1_panel.alpha = 0;
	
	//sound file


	while(splash1_panel.alpha <=100)
	{
		splash1_panel.alpha += 2*time_step;
		wait(1);
   }
   if(splash1_panel.alpha >=100)
   {
   	wait(-10);
   	splash1_panel.flags &= ~SHOW;	
   	
   }
   logoscreen.flags |= SHOW;
 }


function main()
{
 // video_screen = 1;
  screen_size.x = 800;
  screen_size.y = 600;
  mouse_map = cur;
  mouse_mode = 4;
  
  master_vol = 70; // default volume
  soundtrack_handle = media_loop("Pacman.mp3", NULL, soundtrack_volume); 
  
  options_pan.flags &= ~SHOW;
  ins_pan.flags &= ~SHOW;
  exit_pan.flags &= ~SHOW;
  logoscreen.flags &= ~SHOW;
 
}



what might be the problem...? thanks! laugh
Posted By: carla_mariz

Re: splashscreen problem??! - 01/07/11 01:46

@codeChalleged, it worked now laugh
i saw the problem,,ahaha.. thanks a lot! laugh
Posted By: carla_mariz

Re: splashscreen problem??! - 01/07/11 01:57

but how can i make it fade out???? laugh
i think it would be nice for a splash screen if its fading in then out. laugh
Posted By: xbox

Re: splashscreen problem??! - 01/07/11 04:03

while(splash1_panel.alpha >=100)
{
splash1_panel.alpha -= 2*time_step;
wait(1);
}
Posted By: carla_mariz

Re: splashscreen problem??! - 01/07/11 05:05

i've been trying to do this:

Code:
function splashout()
{
	splash1_panel.flags = UNTOUCHABLE | SHOW | TRANSLUCENT;
	splash1_panel.alpha = 0;
	
	//sound file


	while(splash1_panel.alpha <=100)
	{
		splash1_panel.alpha += 2*time_step;
		wait(1);
   }
   while(splash1_panel.alpha >=100)
	{
		splash1_panel.alpha -= 2*time_step;
		wait(1);
   } 
   if(splash1_panel.alpha <=100)
   {
   wait(-10);
   splash1_panel.flags &= ~SHOW; 	
   }
   logoscreen.flags |= SHOW;
 }



but it doesn't fade out..?
Posted By: Quad

Re: splashscreen problem??! - 01/07/11 05:54

because you said

while(splash1_panel.alpha >=100)

while alpha is GREATER than 100

say


while(splash1_panel.alpha <=0)
instead
Posted By: carla_mariz

Re: splashscreen problem??! - 01/10/11 12:06

still not working .. T_T
Posted By: MrGuest

Re: splashscreen problem??! - 01/11/11 14:42

lol
Code:
while(panel.alpha > 0){ //while it's visible, not <= 0 and not >= 100
  panel.alpha -= time_step * 2;
  wait(1);
}


Posted By: carla_mariz

Re: splashscreen problem??! - 01/11/11 22:15

ohh...thanks!!!
it worked now.. grin
© 2024 lite-C Forums