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

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

            RefreshBounds();
        }
Exemple #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;
        }
Exemple #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;
 }
Exemple #6
0
        public SelectableBlock(Rectangle bounds, Block block, GUIElement parent) : base(bounds, parent)
        {
            this.block = block;

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

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