Exemple #1
0
        public TextButton(Texture2D texture, Vector2 position, Color color, Vector2 scale, float rotation, SpriteFont font, Keys key)
            : base(texture, position, color, scale, rotation)
        {
            var origin = new Vector2(font.MeasureString("M").X / 2, font.MeasureString("M").Y / 2);

            TextSprite = new TextSprite(key.ToString(), font, position, Color.Black, Vector2.One * 2, origin, 0f);
            Key        = key;
        }
Exemple #2
0
 public override void Draw(SpriteBatch spriteBatch)
 {
     base.Draw(spriteBatch);
     TextSprite.Draw(spriteBatch);
 }