protected override void DrawElement(ISpritebatch sb) { if (sb != null) { if (this.BackgroundImage != null) { sb.Draw(this.BackgroundImage, this.Bounds, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, .8f); } if (this.BackgroundColorTexture != null) { sb.Draw(this.BackgroundColorTexture, this.Bounds, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.2f); } if (this.Border.BorderTexture != null) { sb.Draw(this.Border.BorderTexture, this.Border.Bounds, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.25f); } if (this.TextFont != null) { var length = this.TextFont.MeasureString(this.Text); sb.DrawString(this.TextFont, this.Text, this.Bounds.Center.ToVector() - (length / 2f), this.TextColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.3f); } } }
protected override void DrawElement(ISpritebatch sb) { if (sb != null && this.IsEnabled && this.Visibility == Visibility.Visible) { sb.Draw(this.BackgroundColorTexture, this.Bounds, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.2f); if (this.Font != null) { var cropped = this.SubstringToWidth(this.Bounds.Width); sb.DrawString(this.Font, cropped, new Vector2(this.Bounds.X + 2, this.Bounds.Center.Y - (this.TextHeight / 2)), this.TextColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.3f); } if (this.CanEdit && this.IsActive && this.ShowCursor) { sb.Draw(this.CursorTexture, new Vector2(this.Bounds.X + this.WidthToIndex(this.cursorPos) + 2, this.Bounds.Y), null, Color.White, 0f, Vector2.Zero, new Vector2(1f, this.cursorScale), SpriteEffects.None, 0.4f); } } }
public void Draw(ISpritebatch sb) { if (sb != null) { sb.Draw( this.Texture, this.Location, null, Color.White, 0f, Vector2.Zero, this.Scale, SpriteEffects.None, this.Depth); } }
public void Draw(ISpritebatch sb) { if (sb != null) { sb.Draw( this.Texture, this.Location, null, Color.White, 0f, this.Location, this.Scale, SpriteEffects.None, this.Depth); } }
public override void Draw(ISpritebatch sb) { if (sb != null) { base.Draw(sb); sb.Draw(this.menuBack, Vector2.Zero, Color.White); sb.DrawString( ContentController.Instance.GetContent<SpriteFont>("MenuFont"), "PAUSED", new Vector2(100, 50), Color.White, 0f, Vector2.Zero, 5f, SpriteEffects.None, 1f); } }
public override void Draw(ISpritebatch sb) { if (sb != null) { base.Draw(sb); sb.Draw(this.menuBack, Vector2.Zero, Color.White); sb.DrawString( ContentController.Instance.GetContent<SpriteFont>("MenuFont"), "Menu Screen: \n\n Press enter to begin game \n\n Esc to Quit", new Vector2(100, 50), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f); } }
public void Draw(ISpritebatch sb) { if (sb != null) { foreach (var texture in this.textures) { if (texture.Item1 != null) { sb.Draw( texture.Item1, this.MapBodyInfo.Position + texture.Item2, null, Color.White, this.Body.Rotation, this.MapBodyInfo.ShapeOffset, 1f, SpriteEffects.None, this.fill ? 0.6f : .5f); } } } }
public void Draw(ISpritebatch sb) { if (sb != null) { foreach (var texture in this.textures) { if (texture.Item1 != null) { sb.Draw( texture.Item1, this.MapBodyInfo.Position + texture.Item2, null, Color.White, this.MapBody.Rotation, this.MapBodyInfo.ShapeOffset, 1f, SpriteEffects.None, this.fill ? 0.6f : .5f); } } } }
public virtual void Draw(ISpritebatch sb) { if (this.IsEnabled) { if (sb != null && this.VisibleState == Visibility.Visible) { foreach (var sprite in this.Sprites.Values) { var effect = SpriteEffects.None; if (sprite.CurrentAnimation.FlipHorizontal) { effect |= SpriteEffects.FlipHorizontally; } if (sprite.CurrentAnimation.FlipVertical) { effect |= SpriteEffects.FlipVertically; } // if the actor does not rotate with the world, keep it upright float drawRotation = this.RotatesWithWorld ? this.Rotation + (-1 * this.Screen.ScreenRotation) : this.Rotation; sb.Draw( sprite.SpriteSheet, this.Position - Vector2.Transform(this.bodyInfo.ShapeOffset, Matrix.CreateRotationZ(drawRotation)) + sprite.Offset, sprite.CurrentSprite, Color.White, drawRotation, Vector2.Zero, 1f, effect, sprite.Depth); } } } }
public virtual void Draw(ISpritebatch sb) { if (this.IsEnabled) { if (sb != null && this.VisibleState == Visibility.Visible) { foreach (var sprite in this.Sprites.Values) { var effect = SpriteEffects.None; if (sprite.CurrentAnimation.FlipHorizontal) { effect |= SpriteEffects.FlipHorizontally; } if (sprite.CurrentAnimation.FlipVertical) { effect |= SpriteEffects.FlipVertically; } // if the actor does not rotate with the world, keep it upright float drawRotation = -1 * this.Screen.ScreenRotation; if (this.RotatesWithWorld) { drawRotation = this.Rotation; } sb.Draw( sprite.SpriteSheet, this.Position + sprite.Offset - this.bodyInfo.ShapeOffset, sprite.CurrentSprite, Color.White, drawRotation, Vector2.Zero, 1f, effect, sprite.Depth); } } } }
public virtual void Draw(ISpritebatch sb) { if (this.IsEnabled) { if (sb != null && this.VisibleState == Visibility.Visible) { foreach (var sprite in this.Sprites.Values) { var effect = SpriteEffects.None; if (sprite.CurrentAnimation.FlipHorizontal) { effect |= SpriteEffects.FlipHorizontally; } if (sprite.CurrentAnimation.FlipVertical) { effect |= SpriteEffects.FlipVertically; } sb.Draw( sprite.SpriteSheet, this.Position + sprite.Offset - this.bodyInfo.ShapeOffset, sprite.CurrentSprite, Color.White, this.Rotation, Vector2.Zero, 1f, effect, sprite.Depth); } } } }