SpriteMaster

Community Forums/Showcase/SpriteMaster

EOF(Posted 2004) [#1]
SpriteMaster is a single-surface 3D sprite system for Blitz3D.
It is loosely based on my SpriteControl functions.




Features:
* Single-surface pixel-perfect (animated) sprites
* Easy to use
* Quick loading of images (compared to SpriteControl)
* Fast system (single-surface quads)

Currently, SpriteMaster has these commands available:

SpriteGraphics
EndSpriteGraphics
SpriteCameraZoom
LoadSpritePack()
FreeSpritePack
GetPackedSprite()
CountPackedSprites()
CountSpriteFrames()
SpriteFrame()
SpriteX()
SpriteY()
RotateSprite
SpriteAngle()
CopySprite()
ResizeSprite
SpriteWidth()
SpriteHeight()
HandleSprite
SpriteXHandle()
SpriteYHandle()
SpriteColor
SpriteAlpha
GetSpriteAlpha()
SpriteRed()
SpriteGreen()
SpriteBlue()
SpriteName$()
ResetSprite
FreeSprite
FlipSprite


You may also wish to download ImagePacker. A tool for packing images into a single larger image/texture suitable for SpriteMaster.


DOWNLOAD SpriteMaster


There is also a 2D version of SpriteMaster called ImageMaster. Operates pretty much the same but for use with standard 2D images. This is included in the zip.



******************
Still to do:
* Draw priority
* Collisions (SpritesOverlap)
* Text routines
* Finish the docs
* userlib decs for the commands
******************

CREDITS:
Rob Cummings - General help and advice
Skidracer - Pixel perfect sprites


QuickSilva(Posted 2004) [#2]
Great set of functions. I`m eagerly awaiting some form of collision checks to be added. Keep up the good work!

Jason.


Rob(Posted 2004) [#3]
Wonderful lib.
The only improvement possible would be a form of vector collision checking. As for me, I'm happy in rect land.


RetroBooster(Posted 2004) [#4]
A brilliant piece of work indeed syntax error.


EOF(Posted 2004) [#5]
Thanks guys.
Collisions to come ...

andreas_blixt over at BlitzCoder has an 'Oriented Bounding Box' collion routine which I'm looking into at the moment.


fredborg(Posted 2004) [#6]
Superb!


ashmantle(Posted 2004) [#7]
Looking very interesting!


BlitzSupport(Posted 2004) [#8]
Wow, this + ImageMaster -- really good stuff! Thanks Syntax!


Paul "Taiphoz"(Posted 2004) [#9]
This is class. top work m8.


Litobyte(Posted 2004) [#10]
Known Issues:
Sprites may show a thin border line when rotated/resized. To avoid this leave a border of around 4 pixels around the image.
Have you tried to load the texture for the quad, with the 48 (16+32) texture flag ?

This should "fix" the nasty border.


roboslug(Posted 2004) [#11]
Haven't looked at this yet, but have used SpriteControl, where adding 48 to the texture flag fixed the bad border in that library.

Thanks for the new contributions, looking forward to playing with this and the packer.


EOF(Posted 2004) [#12]
Thanks. I tried the 32+16 flags to clamp the texture but still get a few lines appearing in places:

They appear at the edges of the quad as you can see by comparing the quads with the wireframe versions.


EOF(Posted 2004) [#13]
Border issues resolved thanks to help from AfroHorse.
See the new 'Set Image Border' in Image Packer.

Updated:
* to handle border settings from Image Packer
* A couple of examples added
* Docs (incomplete)

This single-surface stuff is fast.
My rig can handle around 1280 sprites!!!
<AMD 1600 Geforce4MX 64MB Windoze XtraPoo>



Test program -> Speed Test


darklordz(Posted 2004) [#14]
ran fine speeds started to decrease around 1400 sprites...


Boiled Sweets(Posted 2004) [#15]
Any chance of text functions? For HUDS etc


EOF(Posted 2004) [#16]
Any chance of text functions? For HUDS etc
Working on it ...


Red(Posted 2004) [#17]
Great Job :)