Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- namespace ProgrammingMonoGameTutorial
- {
- public class Game1 : Game
- {
- GraphicsDeviceManager graphics;
- SpriteBatch spriteBatch;
- Texture2D image;
- Sprite sprite;
- public Game1()
- {
- graphics = new GraphicsDeviceManager(this);
- Content.RootDirectory = "Content";
- }
- protected override void LoadContent()
- {
- spriteBatch = new SpriteBatch(GraphicsDevice);
- image = Content.Load<Texture2D>("cat"); //just the image name
- sprite = new Sprite(image);
- }
- protected override void Update(GameTime gameTime) { }
- protected override void Draw(GameTime gameTime)
- {
- GraphicsDevice.Clear(Color.CornflowerBlue);
- spriteBatch.Begin();
- sprite.Draw(spriteBatch);
- spriteBatch.End();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement