Cubios::Gfx::SpriteAtlas
Constructors
SpriteAtlas
Summary
Constructs an object for storing multiple images in a set (an atlas)
Arguments
- filename - name of an image file that holds a set of images to be added to the atlas
- scene - pointer to current Scene object
Synopsis
Comments
When creating a class, you must specify a template parameter - a class that is or is inherited from SpriteBaseElement
Public Methods
AddSprite
Summary
Adds a new sprite with the given ID to the atlas
Arguments
- id - new sprite identifier
- rc - rectangular area on the source texture that will be cut out and added as a sprite
Output
Returns true if function call succeeds, otherwise false.
Synopsis
RemoveSprite
Summary
Removes a sprite with the given ID from the atlas
Arguments
- id - sprite identifier
Output
Returns true if function call succeeds, otherwise false.
Synopsis
Get
Summary
Gets a pointer to a sprite atlas element with the given ID
Arguments
- id - sprite identifier
Output
A pointer to an instance of the class provided with the template argument during construction.
Synopsis
Count
Summary
Returns the number of sprite elements in the atlas
Synopsis
ElementsInsertionOrder
Summary
Allows to retrive a list of sprite identifiers in the order of their addition to the atlas
Output
A pointer to a vector with sprite identifiers.
Synopsis
Public Operators
operator []
Summary
Gets a pointer to a sprite atlas element with the given ID
Arguments
- id - sprite identifier
Output
A pointer to an instance of the class provided with the template argument during construction.
Synopsis