Example #1
0
 public TextBox(int x, int y, int z, int width, int height, State state)
     : base(x, y, z, width, height, state)
 {
     this.DisableHorizontalScroll();
     _lines = new List<string>();
     _lines.Add("");
     _cursorRow = _cursorColumn = 0;
     _lastKey = -1;
     _maxChar = 10000;
     state.AddKeyListener(this);
     _backgroundColor = Color4.White;
 }
Example #2
0
 public TextField(int x, int y, int z, int width, State state)
     : base(x, y, z, width, 0, state)
 {
     int height = Graphics.GetFont().GetLineHeight();
     Resize(width, height + (_borderThickness * 2));
     _text = "";
     _active = false;
     _cursorPos = 0;
     _lastKey = -1;
     _maxChar = 10000;
     state.AddKeyListener(this);
     _backgroundColor = Color4.White;
 }
Example #3
0
        public Control(int x, int y, int width, int height, State state)
        {
            state.AddMouseListener(this);
            state.AddKeyListener(this);

            _bodyPosition = new Vector3();
            _bodySize     = new Vector3(1, 1, 1);
            _worldBody    = new Rectangle(0, 0, 1, 1);

            SetPosition(x, y);
            SetSize(width, height);

            _borderColour     = new Color4(85, 85, 85, 255);    // Color4.RoyalBlue;
            _backgroundColour = new Color4(110, 110, 110, 255); // Color4.LightBlue;

            _pressed = _disabled = false;

            _state = state;
        }