Animated sprites on panels?

Posted By: NeoJones

Animated sprites on panels? - 11/06/15 07:23

Hey guys,

I need some animations on panels. So I know that I can define a bmap array and loop thru this array in a while loop to change the panel.bmap.
But anyone knows, if is there an easier way to manage this?

Animated sprites dont work on panels... (Someone correct me if Iam wrong)

Regards, DF
Posted By: Anonymous

Re: Animated sprites on panels? - 11/07/15 22:31

Animated sprites dont work on panels... (Someone correct me if Iam wrong)


I would assume you could create a animated View-Entity sprite, the place it's layer 1 higher then the panel and then place it's pos_x/y to be in the correct screen spot..

As it is a sprite simple changing it's frame by time_step*a_speed should animate it

my.frame +=2*time_step;



Just some ideas to play with
Posted By: NeoJones

Re: Animated sprites on panels? - 11/07/15 23:32

Thanks Malice. If I understand right, I need for every animation 1 View-Entity and 1 Sprite-Entity + action to change the frames.
At the moment I dont know, if this needs more lines of code as my current solution with a BMAP* array...

I searched for swf plugin, too. This would be exactly what I need, but I found only dead links.
Posted By: Anonymous

Re: Animated sprites on panels? - 11/08/15 03:20

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>

///////////////////////////////
BMAP* city_bmp = "city.tga";
PANEL* my_panel =
{
	pos_x = 100;
	pos_y = 50;
    bmap = city_bmp;

	flags = SHOW;
}
function animate_screen()
{
	ENTITY* amn_sprite=	ent_createlayer("explo+13.tga",0,10);
	var for_anm=0;
	while(1)
	{
	amn_sprite.x=200;	
	amn_sprite.frame+=time_step;
	amn_sprite.frame%=13; // from file name
		wait(1);
	}
}
function main()
{
video_mode =9;
animate_screen();
}



Play this this..

If needed I can include links to image city. explo+13 found in template folder.
amn_sprite.x = closer/farther bigger/smaller
amn_sprite.y = left/right screen
amn_sprite.z = up/down screen

http://www.conitec.net/beta/flags.htm
flags can be set by amn_sprtite.flags2 |= SHOW; &=~SHOW;

Ignoring the anm_panel and instead creating amn view entities may be better. Also there are other ways I will have to play around with to know, such as, it is possible to create a whole 3d cut scene in a unviewed level area then render it to a on screen VIEW* or into a onscreen panel->bmap

Posted By: txesmi

Re: Animated sprites on panels? - 11/08/15 07:36

A window on a panel could be a solution too.

Code:
BMAP *bmpSprite = "explo+7.pcx";
var nSpriteFrame = 0;
PANEL *panSprite =
{
   window ( 0, 0, 180, 180, bmpSprite, nSpriteFrame, NULL );
}



Salud!
Posted By: NeoJones

Re: Animated sprites on panels? - 11/08/15 08:50

Thanks guys! Yes it works, Malice laugh
© 2024 lite-C Forums