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

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

             if (components.Contains(comp))
            components.Remove(comp);
             comp.ParentComponent = null;
        }
Пример #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);
        }
Пример #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);
        }