internal virtual BaseUIElement Clone(BaseUIElement bue, BaseUIElement parent, UICollection parentCollection)
        {
            bue.uiElementRender  = new RenderTarget2D(bue.UIElementRender.GraphicsDevice, bue.UIElementRender.Width, bue.UIElementRender.Height);
            bue.parent           = parent;
            bue.collectionParent = parentCollection;

            return(bue);
        }
        internal override BaseUIElement Clone(BaseUIElement bue, BaseUIElement parent, UICollection parentCollection)
        {
            GButton temp = (GButton)this.MemberwiseClone();

            temp.ButtonAnim_ClickState = temp.ButtonAnim_ClickState.Clone();
            temp.ButtonAnim_HoverState = temp.ButtonAnim_HoverState.Clone();
            temp.ButtonAnim_ClickState = temp.ButtonAnim_ClickState.Clone();

            return(base.Clone(temp, parent, parentCollection));
        }
        public void AddElement(BaseUIElement be)
        {
            if (elementsInCollection == null)
            {
                elementsInCollection = new List <BaseUIElement>();
                if (be.GetType() != typeof(UIScreen))
                {
                    elementsInCollection.Add(new UIScreen());
                    elementsInCollection.Last().ElementID   = ElementIDCount++;
                    elementsInCollection.Last().size        = new Point(500, 300);
                    elementsInCollection.Last().initialSize = new Point(500, 300);
                    if (startMainElement == null)
                    {
                        startMainElement = elementsInCollection.Last() as UIScreen;
                    }
                }
            }

            if (elementsInCollection.Count == 0 && be.GetType() != typeof(UIScreen))
            {
                elementsInCollection.Add(new UIScreen());
                elementsInCollection.Last().ElementID = ElementIDCount++;
                if (startMainElement == null)
                {
                    startMainElement = elementsInCollection.Last() as UIScreen;
                }
            }

            elementsInCollection.Add(be);
            elementsInCollection.Last().ElementID = ElementIDCount++;

            if (startMainElement == null && elementsInCollection.Count == 1 && elementsInCollection.Last().GetType() == typeof(UIScreen))
            {
                startMainElement = elementsInCollection.Last() as UIScreen;
            }
        }
        internal override BaseUIElement Clone(BaseUIElement bue, BaseUIElement parent, UICollection parentCollection)
        {
            UIScreen temp = (UIScreen)this.MemberwiseClone();

            return(base.Clone(temp, parent, parentCollection));
        }
        public BaseUIElement getElementByName(String name)
        {
            BaseUIElement temp = elementsInCollection.Find(ele => ele.name.Equals(name, StringComparison.OrdinalIgnoreCase));

            return(temp);
        }