Skip to content

4.cLEDSprites Function List

Aaron Liddiment edited this page Nov 16, 2015 · 5 revisions

###cLEDSprites(cLEDMatrixBase *Matrix);
This declares an instance of cLEDSprites and tells it to use Matrix for display of any attached sprites.

###void AddSprite(cSprite *Spr);
This adds a sprite to the end of the sprites list that is to be Updated/Rendered by this class.

###boolean IsSprite(cSprite *Spr);
This checks to see if the sprite is in the sprites list controlled by this class.

###void RemoveSprite(cSprite *Spr);
This removes the sprite from the sprites list controlled by this class.

###void RemoveAllSprites();
This removes all sprites controlled by this class.

###void ChangePriority(cSprite *Spr, SpritePriority_t Priority);
This changes the priority / drawing order for the selected sprite. The Priority can be SPR_FRONT, SPR_BACK, SPR_FORWARD, SPR_BACKWARD.

###void UpdateSprites();
This Updates all the sprites in the sprite list with their respective motion & frame rates if set, and also performs the edge detection for each sprite if selected.

###void RenderSprites();
This displays all the sprites controlled by the class on the led matrix.

###void DetectCollisions(cSprite *srcSpr = NULL);
Only Sprites with valid Mask data will have their collisions detected.
If srcSpr is NULL this scans all the sprites controlled by the class and checks for collisions between any that have their collision option set.
If srcSpr is a valid sprite, it will then just scan for collisions between srcSpr and the sprites controlled by the class.
The cSprite GetFlags() function can then be used to check for any collisions.

Clone this wiki locally