public void AddElement(GUIElement element, int layer = 0) { if (!GUIElements.ContainsKey(layer)) { GUIElements.Add(layer, new List <GUIElement>()); } element.SetParentCanvas(this); GUIElements[layer].Add(element); if (BoundWindow != null) { element.Resize(BoundWindow.Width, BoundWindow.Height); } }
public virtual void Resize() { if (BoundWindow == null) { return; } foreach (var l in GUIElements) { foreach (var element in l.Value) { element.Resize(BoundWindow.Width, BoundWindow.Height); } } PopUpCTL?.Resize(BoundWindow.Width, BoundWindow.Height); }
public void SetPopupElement(GUIElement element) { if (PopUpCTL != null) { PopUpCTL = null; // disable it here? it may need to flush a list? } PopUpCTL = element; if (element != null) { element.ParentCanvas = this; if (BoundWindow != null) { element.Resize(BoundWindow.Width, BoundWindow.Height); } } }