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; }
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); }
public UISprite(Sprite sprite, Vector2 position) : base(sprite.Size, position) { _sprite = sprite; }
public UISprite(Sprite sprite) : this(sprite, new Vector2()) { }