Gamestudio Links
Zorro Links
Newest Posts
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, EternallyCurious, 1 invisible), 852 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
splashscreen problem??! #352663
01/05/11 01:52
01/05/11 01:52
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
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! ^_^

Re: splashscreen problem??! [Re: carla_mariz] #352664
01/05/11 02:27
01/05/11 02:27
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline
Senior Member
xbox  Offline
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
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 ?????

Re: splashscreen problem??! [Re: carla_mariz] #352976
01/06/11 23:06
01/06/11 23:06
Joined: Dec 2009
Posts: 19
Saskatchewan
C
codeChallenged Offline
Newbie
codeChallenged  Offline
Newbie
C

Joined: Dec 2009
Posts: 19
Saskatchewan
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.

Re: splashscreen problem??! [Re: codeChallenged] #352992
01/07/11 01:41
01/07/11 01:41
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
@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

Re: splashscreen problem??! [Re: carla_mariz] #352993
01/07/11 01:46
01/07/11 01:46
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
@codeChalleged, it worked now laugh
i saw the problem,,ahaha.. thanks a lot! laugh

Re: splashscreen problem??! [Re: carla_mariz] #352994
01/07/11 01:57
01/07/11 01:57
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
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

Re: splashscreen problem??! [Re: carla_mariz] #352998
01/07/11 04:03
01/07/11 04:03
Joined: Nov 2006
Posts: 497
Ohio
xbox Offline
Senior Member
xbox  Offline
Senior Member

Joined: Nov 2006
Posts: 497
Ohio
while(splash1_panel.alpha >=100)
{
splash1_panel.alpha -= 2*time_step;
wait(1);
}

Re: splashscreen problem??! [Re: xbox] #353000
01/07/11 05:05
01/07/11 05:05
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
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..?

Last edited by carla_mariz; 01/07/11 05:06.
Re: splashscreen problem??! [Re: carla_mariz] #353001
01/07/11 05:54
01/07/11 05:54
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
because you said

while(splash1_panel.alpha >=100)

while alpha is GREATER than 100

say


while(splash1_panel.alpha <=0)
instead


3333333333
Re: splashscreen problem??! [Re: Quad] #353442
01/10/11 12:06
01/10/11 12:06
Joined: Sep 2010
Posts: 97
C
carla_mariz Offline OP
Junior Member
carla_mariz  Offline OP
Junior Member
C

Joined: Sep 2010
Posts: 97
still not working .. T_T

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1