Last updated
Was this helpful?
Last updated
Was this helpful?
The SpriteManager is a static class which handles addition, removal, and common behavior. The SpriteManager also manages automatically updated PositionedObjects. By default all entity instances are added to the SpriteManager to have their every-frame activity called.
In most cases you will not need to write code to interact with the SpriteManager since most Sprites are created in generated code. However, if you are creating or destroying Sprite instances manually, you will probably need to work with the SpriteMangaer.
The SpriteManager provides numerous methods for for working with . The following sections provide code samples for working with -related methods.
Most AddSprite methods both instantiate a new as well as add it to SpriteManager for management. The following methods instantiate and add a to the SpriteManager:
Adding Sprites and Layers
Sprites which have already been created can be moved to layers.
The Sprite will no longer be an un-layered Sprite. Similarly entire lists can be added:
RemoveSprite can also remove entire lists:
The SpriteManager provides read only access to its internal lists for debugging. It is not recommended to directly work with objects through these lists. The following lists the read only lists available:
AutomaticallyUpdatedSprites
DrawableBatches
SpriteFrames
ManagedPositionedObjects
These are static so you simply access them through the SpriteManager:
These lists are used by the ScreenManager to verify that all objects have been destroyed.
For information on content managers, see the .
Sprites can also be added to .
For more information, see the .
The RemoveSprite methods remove from the engine as well as two way PositionedObjectLists that the belong to.
For more information see .
See the .