Texture2D
Introduction
Displaying a Texture
Texture2D texture2D = FlatRedBallServices.Load<Texture2D>("redball.png");
// AddSprite will both instantiate a Sprite and add it so it is rendered by FlatRedBall
Sprite sprite = SpriteManager.AddSprite(texture2D);
sprite.PixelScale = 1;Creating a Texture2D
using Microsoft.Xna.Framework.Graphics; // If loading from file, use the extension:
Texture2D loadedTexture = FlatRedBallServices.Load<Texture2D>("someGraphic.png");
// otherwise, if loading through content pipeline, exclude the extension:
Texture2D loadedTexture = FlatRedBallServices.Load<Texture2D>("someGraphic");Transparency
Power of 2
Last updated
Was this helpful?