To animate an Panel use this simple code:
Code:
BMAP* animated_sprite = "explo+7.png"; // Here your file
var animation_offset = 0;

PANEL* panel_animate = 
{
	pos_x = 10;
	pos_y = 10;
	window(0,0,180,180,animated_sprite,animation_offset,0); // Replace 180,180 with the size of one sprite
	flags = SHOW;
}

function animate_panel() // Run to start animation
{
	int iWidth = bmap_width(animated_sprite);
	int iHeight = bmap_height(animated_sprite);
	while(1)
	{
		animation_offset += iHeight;
		animation_offset %= iWidth;
		wait(-0.05); // Animation speed
	}
}


The testing image:


Quote:

New code:
The code configures the animate_panel() to right sprite size and number.
You must only set the sprite size in the window definition (180,180) in panel_animate. Run animate_panel() to start the animation.


Last edited by Richi007; 01/03/10 13:13.

Visit my site: www.masterq32.de