public Button(Rectangle bounds, string label, Action clickAction, GUIElement parent) : base(bounds, parent) { this.label = label; this.clickAction = clickAction; RefreshBounds(); }
public TextBox(Rectangle bounds, GUIElement parent) : base(bounds, parent) { RefreshBounds(); }
public Panel(Rectangle bounds, string label = null, GUIElement parent = null) : base(bounds, parent) { this.label = label; RefreshBounds(); }
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; }
/// <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; }
public SelectableBlock(Rectangle bounds, Block block, GUIElement parent) : base(bounds, parent) { this.block = block; RefreshBounds(); }
public void AddScrollable(GUIElement element) { element.ApplyOffset(offset + innerOffset); scrollContainer.Add(element); element.SetParent(scrollContainer); }
public void Remove(GUIElement element) { elements.Remove(element); }
public void Add(GUIElement element) { elements.Add(element); }
//TODO: maybe some stuff for text fields public GUIContainer(Rectangle bounds, GUIElement parent = null) : base(bounds, parent) { elements = new HashSet <GUIElement>(); }
public void Add(GUIElement element) { element.ApplyOffset(offset); contents.Add(element); }