Développement XNA pour la XBox et le PC
98
public class ChapitreSix : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Sprite sprite;
public ChapitreSix()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
sprite = new Sprite(100, 100);
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
sprite.LoadContent(Content, "GameThumbnail");
}
protected override void UnloadContent()
{
}
protected override void Update(GameTime gameTime)
{
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
sprite.Draw(spriteBatch);
spriteBatch.End();
base.Draw(gameTime);
}
}
Figure 6-1
Votre projet devrait ressembler
à ceci
=Labat FM.book Page 98 Vendredi, 19. juin 2009 4:01 16
Précédent

- 119/366

Suivant