Kein problem wink

hier ist der code-auszug:
Code:
int splash_num = 0;
int splash_num_current = 0;

void show_picture(STRING* _pic, var _time_in, var _time_stay, var _time_out)
{
	int _my_splash_num = splash_num;
	
	splash_num++;
	
	//> Wait until all previous Pictures were displayed
	while(splash_num_current < _my_splash_num) wait(1);
	
	
	//> Create a Panel
	
	BMAP* _temp_bmap = bmap_create(_pic);
	PANEL* _temp_pan = pan_create("flags = SHOW | TRANSLUCENT; alpha = 0;",1000);
	
	
	//> Set bmap and position
	
	_temp_pan.bmap = _temp_bmap;
	_temp_pan.pos_x = screen_size.x / 2 - bmap_width(_temp_bmap) / 2;
	_temp_pan.pos_y = screen_size.y / 2 - bmap_height(_temp_bmap) / 2;
	
	
	//> Fade in

	var _alpha_temp = 100 / (_time_in * fps_max);
	
	while(_temp_pan.alpha < 100)
	{
		_temp_pan.alpha += _alpha_temp;
		wait(1);
	}
	_temp_pan.alpha = 100;
	
	
	//> Wait
	
	wait(-_time_stay);
	
	
	//> Fade out
	
	_alpha_temp = 100 / (_time_out * fps_max);
	
	while(_temp_pan.alpha > 0)
	{
		_temp_pan.alpha -= _alpha_temp;
		wait(1);
	}
	
	splash_num_current++;
	
	//> Delete it again
	ptr_remove(_temp_pan);
	ptr_remove(_temp_bmap);
}



Das ganze wird so aufgerufen:
show_picture("picture.png", 1, 0.2, 1.5);

Das würde jetzt das bild picture.png 1 Sekunde lang einblenden, 0.2 Sekunden lang
stehenlassen und 1.5 Sekunden lang ausblenden

Es ist auch nicht nötig wait(x); zwischen den funktions-aufrufen auszuführen.
Es wird automatisch immer erst das nächste Bild angezeigt, wenn das vorherige ausgeblendet ist.

Last edited by Kartoffel; 06/10/12 14:45.

POTATO-MAN saves the day! - Random