XNA Framework

Miscellaneous Forums/General Discussion/XNA Framework

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

XNA is based on something called a content pipeline, and handles sprites using a SpriteBatch object, so, to load images, you do this:-

//Load the image
cursor = content.Load<Texture2D>("cursor");
//Create a new sprite batch for drawing
spriteBatch = new SpriteBatch(graphics.GraphicsDevice);


Then to draw it, you do this:-

spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
spriteBatch.Draw(cursor, cursorPosition, Color.White);
spriteBatch.End();


I have a few little examples here:-

http://www.syntaxbomb.com/forums/forumdisplay.php?f=83