Atlases, sprites and animated sprites manager
Online Demo: http://www.julien-pierron.com/sample.php?sample=jpspritesample
Forum Link: http://www.shivaengine.com/developer/forum/viewtopic.php?f=82&t=29258
Req. ShiVa Version:
ShiVa 1.9.2 Engines
Plugin Platform Compatibility:
iOS, Android, WinRT ARM/Phone 8, WinRT x86/_64, Windows Legacy, Mac OS X, Linux, Flash, Web Browser, Palm, Marmalade, BlackBerry, Windows Phone 7, Playstation 3, Playstation 4, Xbox 360, Xbox One, Wii
Seller information: Julien Pierron
JPSprite is a pack for atlases, sprites and animated sprites management.
All the best games use an atlas system because it is the best solution to optimize your game: improved performance because the sprites are using the same texture (less draw calls) and reduced memory consumption (a lot of wasted space if each sprite had its own texture).
JPSprite is based on TexturePackerGUI which is a software for atlases creation, which generates a texture containing the sprites and an xml to describe the UV coordinates for each of them.
Once your atlas and its xml file are generated by TexturePackerGUI, import and reference them in your ShiVa game.
Give to JPSprite a HUD component and the name of a sprite and it will apply the correct texture to your component and the corresponding UV coordinates.
It also embeds an animation system. If your atlas contains a serie of sprites ending with consecutive index (starting from 0), JPSprite will consider it as an animation. There are many options, such as the ability to choose the frame rate of the animation, change its scale, and much more.
JPSprite is also equipped with a formidable optimization system. If you decide to enable it, this system will adjust the performances of JPSprite depending on the state of your game. If your game frame rate is low at some time, JPSprite will automatically reduce its own working speed to maximize the resources available for the rest of your game, without any visible impact on the animated sprites.
--Load the atlas. JPSprite will detect the sprites and animations
JPSprite.setupAtlas ( "Avatar" )
--Set the animation named "Talking" to the HUD component, with loop mode enabled
JPSprite.setComponentAnimation ( "ScreenRoot.Avatar", "Talking", true )
--If needed, enable the optimization system
JPSprite.setOptimizationSystemEnabled ( true )
As an example, the game Babel Rising: Cataclysm which can be found in my portfolio uses a similar sprite and optimization system, and the game can display several hundreds of animated sprites at once, keeping a good framerate.
What contains the lite version ?
It contains everything that is not related to the animations:
- Atlas loading.
- Static sprite display for HUD components and objects materials.
What contains the paid version ?
It adds support for animated sprites and contains a very powerful and smart optimisation system.
Below the parameters I recommand to generate your atlases with TexturePackerGUI:
- Data Format: Generic XML
- Size constraints: POT (Power of 2)
- Force squared: enabled
- Allow rotation: disabled
- Trim sprite names: enabled
- ShiVa 1.9.2 or greater
- LUA project (not compatible with full c++ projects, compatible with LUA projects that use c++ plugins)
You can find an introduction to the packs and how to load them in your game here:
API & Instructions
Sample projects that use my packs