public void Draw(SpriteBatch sb) { #if DEBUG hitboxTexture = new Texture2D(sb.GraphicsDevice, 1, 1); // à terme, rendre la texture de hitbox générale? hitboxTexture.SetData(new[] { Color.Red }); sb.Draw(hitboxTexture, HitBox, Color.White * 0.5f); #endif CurrentSprite.Draw(sb, HorizontalFlip); }
/// <summary> /// Override of Character Draw. Drawing a hero may need an offset due to attacking state. /// </summary> /// <param name="gameTime"></param> public override void Draw(GameTime gameTime) { if (this.State == CharacterState.Attacking) { SpriteContainer.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); CurrentSprite.Draw(SpriteContainer, this.Position); SpriteContainer.End(); } else if (this.State == CharacterState.Hit) { float pulsate = GetPulsingValue(gameTime); //float pulsate = (float)Math.Sin(gameTime.TotalGameTime.TotalSeconds * 6) + 1; SpriteContainer.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); CurrentSprite.Draw(SpriteContainer, this.Position, Color.Red, pulsate); SpriteContainer.End(); } else { base.Draw(gameTime); } }
public virtual void Draw(SpriteBatch spriteBatch) { CurrentSprite.Position = Position; CurrentSprite.Draw(spriteBatch); }
/// <summary> /// Octorok Drawing rotates based on direction /// </summary> /// <param name="gameTime"></param> public override void Draw(GameTime gameTime) { SpriteContainer.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend); CurrentSprite.Draw(SpriteContainer, this.Position, this.ObjectDirection); SpriteContainer.End(); }