Exemplo n.º 1
0
        public UIWindowCloseButton(Vector2 position, float scale = 1.0f)
            : base(new Vector2(), position)
        {
            _sprite = new Sprite(PanelsTexture, scale) {
                SubrectOffset = new Vector2(32, 0),
                SubrectSize = new Vector2(16, 16)
            };

            SetSize(16.0f * scale, 16.0f * scale);

            CanResize = false;
        }
Exemplo n.º 2
0
        public UITextBox(Vector2 size, Vector2 position, float scale = 1.0f)
            : base(size, position)
        {
            PaddingLeft = PaddingTop = PaddingRight = PaddingBottom = 4.0f * scale;

            _sprite = new FrameSprite(PanelsTexture, scale) {
                SubrectSize = new Vector2(16, 16),
                SubrectOffset = new Vector2(0, 32),
                FrameTopLeftOffet = new Vector2(4, 4),
                FrameBottomRightOffet = new Vector2(4, 4),
                Size = size
            };

            _font = PixelFont.Large;
            _text = new UILabel(_font, scale);
            AddChild(_text);

            CharacterLimit = (int) (InnerWidth / (_font.CharWidth * scale));

            _underlineChar = new Sprite(scale * _font.CharWidth, scale * 2.0f, OpenTK.Graphics.Color4.Black);
        }
Exemplo n.º 3
0
 public UISprite(Sprite sprite, Vector2 position)
     : base(sprite.Size, position)
 {
     _sprite = sprite;
 }
Exemplo n.º 4
0
        public UISprite(Sprite sprite)
            : this(sprite, new Vector2())
        {

        }