private void PrintString(SpriteBatch spriteBatch, string str, AlignTypes align, int x, int y) { switch (align) { case AlignTypes.Right: x -= (int)Font.MeasureString(str).X; break; case AlignTypes.Center: x -= (int)(Font.MeasureString(str).X / 2); break; } spriteBatch.DrawString(Font, str, new Vector2(x, y), Color); }
public ButtonAttribute(string caption, AlignTypes align = AlignTypes.Top) { Caption = caption; Align = align; }
public ButtonAttribute(AlignTypes align = AlignTypes.Top) { Align = align; }
public ButtonAttribute(AlignTypes align = AlignTypes.Bottom) { Align = align; }