Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Texture2D.FromStream(GraphicsDevice graphicsDevice, Stream stream,
- int width, int height, bool zoom)
- Texture2D tex = Content.Load<Texture2D>("somefile");
- float scale = .5f; //50% smaller
- SpriteBatch.Draw(tex, position, source, Color.White, rotation, scale, SpriteEffects.None, 0f);
- Texture2D texture;
- protected override void LoadContent()
- {
- ...
- texture = Content.Load<Texture2D>("Tank");
- ...
- }
- protected override void Draw(GameTime gameTime)
- {
- ...
- Rectangle destinationRectangle = new Rectangle(100, 100, 30, 10);
- spriteBatch.Draw(texture, destinationRectangle, Color.White);
- ...
- spriteBatch.End();
- base.Draw(gameTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement