simple prob

Posted By: GaniX

simple prob - 10/08/12 17:03

hi all
The problem I have is simple
wanted to know how I could do to turn the camera, the screen is dark until you load the level and subsequently encederla
Posted By: MasterQ32

Re: simple prob - 10/08/12 17:27

i don't understand your problem
can you explain it further?
Posted By: GaniX

Re: simple prob - 10/08/12 18:14

ok. my problem: i wanna know how to turn off the camera when i load a new lvl. then (when the lvl is already charge) i wanna put the camera work again
Posted By: MasterQ32

Re: simple prob - 10/08/12 18:21

the camera gets reset if you load a new level
so you have to setup the position and angles again

Quote:
i wanna know how to turn off the camera

how do you load your level?
this should be done in one frame, so you won't notice it
Posted By: Kartoffel

Re: simple prob - 10/08/12 18:47

Do you mean, that the screen should fade to black, then you load a level and then everything becomes visible again?
Posted By: Widi

Re: simple prob - 10/08/12 18:49

reset(camera,SHOW);
set(camera,SHOW);
??
Posted By: GaniX

Re: simple prob - 10/08/12 18:54

kartoffel : yes that the screen should fade to black, then you load a level and then everything becomes visible again
Posted By: Aku_Aku

Re: simple prob - 10/08/12 18:54

I would create a big black image and show it on a panel.
Alternatively you can set the sun light to zero. And switch off every other lightsources.
Posted By: Uhrwerk

Re: simple prob - 10/08/12 19:39

Maybe this function might also be of help to you:

level_loadsplash (STRING* filename,STRING* bmapname,var mode)

see the documentation here:
http://www.conitec.net/beta/level_c.htm
Posted By: Kartoffel

Re: simple prob - 10/08/12 19:57

here's a simple function as example:
Code:
void load_level_fade_black(STRING* _levelname)
{
	PANEL* TempPan = pan_create("alpha = 0; flags = SHOW | TRANSLUCENT", 1000); // Create a new temp-panel
	BMAP* BmapBlack = bmap_createblack(8, 8, 24); // create an 8x8 black texture
	
	TempPan.bmap = BmapBlack;
	TempPan.size_x = screen_size.x; // set x and y size of the panel to the game-resolution
	TempPan.size_y = screen_size.y;
	
	var p = 0; // percent (1 - 100)
	var Speed = 1.5; // fade-speed per frame
	
	while(p < 100) // fade in
	{
		p += Speed;
		TempPan.alpha = p;
		wait(1);
	}
	
	TempPan.alpha = 100;
	
	level_load(_levelname); // screen is black, load the level now
	
	p = 100;
	while(p > 0) // now the same just backwards
	{
		p -= Speed;
		TempPan.alpha = p;
		wait(1);
	}
	
	TempPan.alpha = 0;
	
	ptr_remove(TempPan);
	ptr_remove(BmapBlack);
}


if you usually use level_load("level.wmb"); you can now use:
load_level_fade_black("level.wmb");
instead - which will do exactly the same, just with fading the screen black before loading the level.

I simply create a panel and assign a black texture to it with the size 8x8.
(2^x textures wich are greater or equal 8x8 px will be repeated seamlessly if the panels' size_x and _y are bigger)
Then I set size_x and _y to the applications' resolution so the complete screen gets covered.

After that I use a simple linear fade-in to show the panel, load the level and then blend it out again.
© 2024 lite-C Forums