Example #1
0
        private void SetButtonPosition(UIBaseComponent comp, int buttonIndex)
        {
            int col = buttonIndex % 2;
            int row = buttonIndex / 2;

            comp.X = 1 + col * 32;
            comp.Y = 35 + row * 24;
        }
Example #2
0
 internal UIBaseComponent()
 {
     BackgroundColor        = new Color(1.0f, 1.0f, 1.0f, 0.0f);
     UserInteractionEnabled = true;
     Visible         = true;
     Alpha           = 1.0f;
     ParentComponent = null;
     components      = new List <UIBaseComponent>();
     Components      = new UIBaseComponentList(components);
 }
Example #3
0
        internal void RemoveComponent(UIBaseComponent comp)
        {
            if (comp == null)
            {
                return;
            }

            if (components.Contains(comp))
            {
                components.Remove(comp);
            }
            comp.ParentComponent = null;
        }
Example #4
0
        internal void AddComponent(UIBaseComponent newComp)
        {
            if (newComp == null)
            {
                return;
            }

            if (newComp.ParentComponent != null)
            {
                newComp.ParentComponent.RemoveComponent(newComp);
            }

            newComp.ParentComponent = this;
            components.Add(newComp);
        }
Example #5
0
        internal Vector2 ConvertLocalToGlobal(Vector2 localCoords)
        {
            Vector2         result = localCoords;
            UIBaseComponent comp   = this;

            while (comp != null)
            {
                result.X += comp.X;
                result.Y += comp.Y;

                comp = comp.ParentComponent;
            }

            return(result);
        }
Example #6
0
        internal void InsertComponent(UIBaseComponent newComp, int atPosition)
        {
            if (newComp == null)
            {
                return;
            }

            if (newComp.ParentComponent != null)
            {
                newComp.ParentComponent.RemoveComponent(newComp);
            }

            newComp.ParentComponent = this;

            components.Insert(atPosition, newComp);
        }
Example #7
0
        private void SetButtonPosition(UIBaseComponent comp, int buttonIndex)
        {
            int col = buttonIndex % 2;
             int row = buttonIndex / 2;

             comp.X = 1 + col * 32;
             comp.Y = 35 + row * 24;
        }
Example #8
0
        internal void RemoveComponent(UIBaseComponent comp)
        {
            if (comp == null)
            return;

             if (components.Contains(comp))
            components.Remove(comp);
             comp.ParentComponent = null;
        }
Example #9
0
        internal void InsertComponent(UIBaseComponent newComp, int atPosition)
        {
            if (newComp == null)
            return;

             if (newComp.ParentComponent != null)
            newComp.ParentComponent.RemoveComponent(newComp);

             newComp.ParentComponent = this;

             components.Insert (atPosition, newComp);
        }
Example #10
0
        internal void AddComponent(UIBaseComponent newComp)
        {
            if (newComp == null)
            return;

             if (newComp.ParentComponent != null)
            newComp.ParentComponent.RemoveComponent(newComp);

             newComp.ParentComponent = this;
             components.Add(newComp);
        }