Page 1 of 1
AnimateSprite
Posted: Fri Jan 30, 2009 8:48 pm
by J. Baker
I could probably figure this out but thought it would be a good request. Preferably compatible with png with alpha channel. Which I don't think would be a problem since current sprites are already.
AnimateSprite(#Sprite, Width, Height, Start X, Start Y, End X, End Y, FPS)
Posted: Fri Jan 30, 2009 9:04 pm
by Kaeru Gaman
it's not that big problem to create it yourself, but it would be quite a problem to integrate it into the language properly.
1. Alpha ot not means Sprite3D or not.
without alpha, you can use any kind of sprite to get it animated.
2. Animation rate
> AnimateSprite(#Sprite, Width, Height, Start X, Start Y, End X, End Y,
FPS)
to sync your game is something that is completely up to you.
when you sync your game to frames or tics, you would sync your animation frames to the same base.
when you write your game timebased with independent framerate,
you could either sync your sprites to the timer or still to tics.
to create a bunch of routines that are flexible enough to cope with all situations a game progger may need would create a heavy overload in the routine and need too much efford on side of the creators.
if you need inspiration to write your own routines, I can provide an example a bit older...
http://www.purebasic.fr/german/viewtopic.php?t=2218
Posted: Fri Jan 30, 2009 9:39 pm
by J. Baker
Well, it shouldn't be too hard either way. I'm just trying to think through on how to get an animated sprite done with alpha support. As it looks a lot nicer. And as you know, ClipSprite doesn't work with Sprite3D.
Posted: Fri Jan 30, 2009 9:50 pm
by Kaeru Gaman
it is not necessary to work with ClipSprite.
to be honest, I dislike this approach nowadays, I would alter the routine for creating the animation if I did it again.
for own projects, I always work with rows of single frames.
changing this to Sprite3D will cost nothing but taking care the source frames are (2^n)²
and there is another point:
implementing an AnimateSprite commando would mean to cope with every kind of Frameset PLUS single stored frames...
just one more point to strengthen my opinion that it would be not of much use if Fred wastes time with implementing such a complicated command.
Posted: Fri Jan 30, 2009 9:52 pm
by Fluid Byte
J. Baker wrote:And as you know, ClipSprite doesn't work with Sprite3D.
http://www.purebasic.fr/english/viewtop ... 78&start=5
Posted: Sat Jan 31, 2009 7:36 am
by Kaeru Gaman
nice one, Fluid.
yap, there are ways to clip a Sprite3D, but as I said, clipping is not vital for an animation.
one could even import a frameset, cut it into single frames and create single sprites out of them,
then delete the frameset and create Sprite3Ds out of the single framesprites.
what I meant above is...
it is not complicated to write an animation routine that fits into a certain setting of screen and grafix handling.
but it is quite complicated to write a universal animation command that fits well into
each and every setting of screen environment you can create with PureBasic.
then it would be even better to write a complete 2D-Gamelib that contains timing routines and an own tile-engine aswell
a whole set of 2D screen game commands including one straight type of animation.
Posted: Wed Feb 04, 2009 2:55 pm
by J. Baker
Thanks!
