Exemplo n.º 1
0
        public Button(Rectangle bounds, string label, Action clickAction, GUIElement parent) : base(bounds, parent)
        {
            this.label       = label;
            this.clickAction = clickAction;

            RefreshBounds();
        }
Exemplo n.º 2
0
 public TextBox(Rectangle bounds, GUIElement parent) : base(bounds, parent)
 {
     RefreshBounds();
 }
Exemplo n.º 3
0
        public Panel(Rectangle bounds, string label = null, GUIElement parent = null) : base(bounds, parent)
        {
            this.label = label;

            RefreshBounds();
        }
Exemplo n.º 4
0
        protected bool hovered;         //Set by the base Update() to be true iff the mouse is over top of this GUIElement.

        protected GUIElement(Rectangle bounds, GUIElement parent = null)
        {
            this.bounds = bounds;
            this.parent = parent;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Changes the parent of this GUIElement (i.e. for when the actual parent is initially inaccessible).
 /// </summary>
 public void SetParent(GUIElement newParent)
 {
     parent = newParent;
 }
Exemplo n.º 6
0
        public SelectableBlock(Rectangle bounds, Block block, GUIElement parent) : base(bounds, parent)
        {
            this.block = block;

            RefreshBounds();
        }
Exemplo n.º 7
0
 public void AddScrollable(GUIElement element)
 {
     element.ApplyOffset(offset + innerOffset);
     scrollContainer.Add(element);
     element.SetParent(scrollContainer);
 }
Exemplo n.º 8
0
 public void Remove(GUIElement element)
 {
     elements.Remove(element);
 }
Exemplo n.º 9
0
 public void Add(GUIElement element)
 {
     elements.Add(element);
 }
Exemplo n.º 10
0
        //TODO: maybe some stuff for text fields

        public GUIContainer(Rectangle bounds, GUIElement parent = null) : base(bounds, parent)
        {
            elements = new HashSet <GUIElement>();
        }
Exemplo n.º 11
0
 public void Add(GUIElement element)
 {
     element.ApplyOffset(offset);
     contents.Add(element);
 }