예제 #1
0
        public Button(SpriteFont font, Vector2 position, Vector2 size, string text, Texture2D texture)
        {
            baseColor  = new Color(50, 50, 50);
            Color      = baseColor;
            Texture    = texture;
            Position   = position;
            Size       = size;
            staticText = new StaticText();
            outline    = new Sprite(texture)
            {
                Position = new Vector2(Position.X - 1, Position.Y - 1), Size = new Vector2(Size.X + 2, Size.Y + 2), Color = Color.Black
            };
            var textSize = font.MeasureString(text);

            staticText.Font     = font;
            staticText.Msg      = text;
            staticText.Position = Helper.Center(Rectangle, textSize);
            staticText.Color    = Color.White;
        }
예제 #2
0
 public Popup()
 {
     Text      = new StaticText();
     Text.Font = ScreenManager.DebugFont;
 }