Exemple #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;
        }
Exemple #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);
 }
Exemple #3
0
        internal void RemoveComponent(UIBaseComponent comp)
        {
            if (comp == null)
            {
                return;
            }

            if (components.Contains(comp))
            {
                components.Remove(comp);
            }
            comp.ParentComponent = null;
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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;
        }
Exemple #8
0
        internal void RemoveComponent(UIBaseComponent comp)
        {
            if (comp == null)
            return;

             if (components.Contains(comp))
            components.Remove(comp);
             comp.ParentComponent = null;
        }
Exemple #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);
        }
Exemple #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);
        }