GLBasic forum

Main forum => GLBasic - en => Topic started by: Ian Price on 2010-Jan-15

Title: New command request - GRABANIM
Post by: Ian Price on 2010-Jan-15
Hi Gernot

Would it be possible to create a new command - GRABANIM ??

Usage (similar to GRABSPRITE, but with frame width and height) - GRABANIM no%, x%, y%, totalwidth%, totalheight%, framewidth, frameheight

This could enable realtime creation of animated sprites and effects - eg could be used in an explosion generator etc.

I know that it's possible to GRABSPRITE and SAVESPRITE then LOADANIM from the grabbed sprite, but the above command could do this all in one.

Or is there something that already does this?
Title: Re: New command request - GRABANIM
Post by: Kitty Hello on 2010-Jan-15
Strange. I had the very same requirement just a minute ago for my WizSticks...

I think, I'll just add a command to "tile" a sprite. Internally it's just 2 numbers for each sprite that tell the tile sizes, should be easy to do, thus.
Title: Re: New command request - GRABANIM
Post by: Hatonastick on 2010-Jan-15
Just goes to show that great minds think alike (erm not mine, you two).  :good:
Title: Re: New command request - GRABANIM
Post by: Ian Price on 2010-Jan-16
"Great minds think alike" or "Fools seldom differ"? :P

Nice one :)
Title: Re: New command request - GRABANIM
Post by: Scott_AW on 2010-Jan-18
That would be a rather nice command to have, it could allow for custom sprite sets composed of different images, like layering weapons/clothing/hair/ect. over a template/nude sprite.
Title: Re: New command request - GRABANIM
Post by: FutureCow on 2010-Jan-19
Is the idea to make it so you don't have to create things in realtime?
i.e If you make an explosion generator, you want to capture all the frames created (assuming they were not able to be created in realtime, or were CPU intensive to create in realtime) as a series of images so that you can play them back in realtime?
Title: Re: New command request - GRABANIM
Post by: Ian Price on 2010-Jan-19
Kindof. You create your new animated images at the start of the app, using basic building blocks (or via code) to create multiple new images for an animation, ready to be used later. This would minimize the number of loaded sprites and create totally new ones with new images/colours etc. without adding any extra "weight" to the size of the file (or having to hand draw a load of extra new animations).

I don't want to create an explosion generator, that was just one quick and obvious thing that could be achieved with this command. Scott_AW's example was a good one.