Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
                }
            }
        }