public DrawTexture ( |
||
spriteSheet | The SpriteSheet. | |
rectangle | The Rectangle. | |
color | Color | The Color. |
opacity | float | The Opacity. |
Результат | void |
/// <summary> /// Draws the Skybox. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public void Draw(SpriteBatch spriteBatch, GameTime gameTime) { spriteBatch.DrawTexture(_background, _backgroundPosition); spriteBatch.DrawTexture(_layer1, _layer1Position1); spriteBatch.DrawTexture(_layer2, _layer2Position1); spriteBatch.DrawTexture(_layer1, _layer1Position2); spriteBatch.DrawTexture(_layer2, _layer2Position2); //spriteBatch.DrawTexture(_layer1, _layer1Position3); spriteBatch.DrawTexture(_layer2, _layer2Position3); }
/// <summary> /// Draws the Scene. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public override void Draw(SpriteBatch spriteBatch, GameTime gameTime) { spriteBatch.DrawTexture(_background, _backgroundPosition); Vector2 dim = spriteBatch.MeasureString( string.Format("score: {0}", _finalScore), _font); Vector2 dim2 = spriteBatch.MeasureString("Press {Enter} to continue", _font2); Vector2 dim3 = spriteBatch.MeasureString( string.Format("(Achievement multiplier {0}x)", _achievmentMultiplier), _font3); spriteBatch.DrawString( string.Format("score: {0}", _finalScore), _font, new Vector2(400 - dim.X/2, 300), Color.White); spriteBatch.DrawString(string.Format("(Achievement multiplier {0}x)", _achievmentMultiplier), _font3, new Vector2(400 - dim3.X/2, 350), Color.White); spriteBatch.DrawString("Press {Enter} to continue", _font2, new Vector2(400 - dim2.X/2, 420), Color.White); _blackBlend.Draw(spriteBatch, gameTime); }
/// <summary> /// Draws the Player. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public override void Draw(SpriteBatch spriteBatch, GameTime gameTime) { if (!_isVisible) return; spriteBatch.DrawTexture(Sprite, Position); //healthbar if (!EnableHPBar) return; spriteBatch.FillRectangle(Color.Red, _healthBarRed); spriteBatch.FillRectangle(Color.Green, _healthBarGreen); }
/// <summary> /// Zeichnen der Elemente /// </summary> /// <param name="spriteBatch"></param> /// <param name="gameTime"></param> public void Draw(SpriteBatch spriteBatch, GameTime gameTime) { spriteBatch.DrawTexture(Texture, Position); }
/// <summary> /// Draws the Scene. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public override void Draw(SpriteBatch spriteBatch, GameTime gameTime) { spriteBatch.DrawTexture(_menuBackground, _menuPosition); UIManager.Draw(spriteBatch, gameTime); _blackBlend.Draw(spriteBatch, gameTime); }
/// <summary> /// Draws the Player. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public override void Draw(SpriteBatch spriteBatch, GameTime gameTime) { if (!_isVisible) return; spriteBatch.DrawTexture(Sprite, Position); }
/// <summary> /// Draws the Player. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public override void Draw(SpriteBatch spriteBatch, GameTime gameTime) { spriteBatch.DrawTexture(Sprite, Position); }
/// <summary> /// Draws the Minimap. /// </summary> /// <param name="spriteBatch">The spriteBatch.</param> /// <param name="gameTime">The GameTime.</param> public void Draw(SpriteBatch spriteBatch, GameTime gameTime) { if (!Visible) return; spriteBatch.DrawTexture(_minimap, new Vector2(X, Y), 0.4f); foreach (Vector2 enemy in _enemyPositions) { spriteBatch.FillRectangle(Color.Red, new Rectangle(enemy.X, enemy.Y, 5, 5)); } foreach (Vector2 projectile in _projectilePositions) { spriteBatch.FillRectangle(Color.Blue, new Rectangle(projectile.X, projectile.Y, 2, 2)); } spriteBatch.FillRectangle(Color.Green, new Rectangle(_playerPosition.X, _playerPosition.Y, 5, 5)); }