Tag Archives: tutorial

XNA Tutorial 1: Hello world

Start XNA Game studio and create a new Windows game project.

Right click Content folder and choose Add, New Item.
Select Sprite Font and rename it to some font you like, such as “Arial”.

You can now open the file and modify some of the options such as Size or Style.

Locate the following code:

protected override void Draw(GameTime gameTime)
    // TODO: Add your drawing code here


And finally add the code to draw a string:

spriteBatch.DrawString(Content.Load<SpriteFont>("Arial"), "Hello world", new Vector2(100, 100), Color.Black);


Easy, isn’t it?