Paste
Introduction
Paste and Sprites
Code Example
Texture2D texture = FlatRedBallServices.Load<Texture2D>("redball.bmp", ContentManagerName);
int numberOfSprites = 64 * 64;
MapDrawableBatch map = new MapDrawableBatch(numberOfSprites, texture);
// This is the Sprite that we'll reuse
Sprite sprite = new Sprite();
sprite.Texture = texture;
for (int i = 0; i < numberOfSprites; i++)
{
sprite.X = 2 * (i % 64);
sprite.Y = 2 * (i / 64);
map.Paste(sprite);
}
SpriteManager.AddDrawableBatch(map);Paste does not reference Sprites
Last updated
Was this helpful?