SpriteManager
Introduction
Sprites
Sprite Addition
// This loads the texture "content/redball.png" using the global content manager
// then assigns it to the Sprite's Texture property
Sprite sprite = SpriteManager.AddSprite("content/redball.png");
// This loads the texture "content/redball.png" using a content manager named
// "Content Manager Name" then assigns it to the Sprite's Texture property.
Sprite sprite = SpriteManager.AddSprite("content/redball.png", "Content Manager Name");
// This manually loads the texture and then uses the resulting Texture2D to
// create a Sprite and assigns the Sprite's Texture property.
Texture2D texture = FlatRedBallServices.Load<Texture2D>("redball.bmp");
Sprite sprite = SpriteManager.AddSprite(texture);
// Textures can (and often do) come from generated code, so textures from generated code
// can also be used to instantiate sprites:
Sprite sprite = SpriteManager.AddSprite(TextureFile);Sprite Removal
Managing PositionedObjects
Read Only Lists
Last updated
Was this helpful?