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) { sb.DrawString(this.Font, this.Text, new Vector2(this.Bounds.X, this.Bounds.Center.Y - (this.Font.MeasureString(this.Text).Y / 2f)), this.TextColor, 0f, Vector2.Zero, 1f, 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"), "PAUSED", new Vector2(100, 50), Color.White, 0f, Vector2.Zero, 5f, SpriteEffects.None, 1f); } }
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 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); } }