Example #1
0
        public EleGenButton <ty> AddButton <ty>(string text, float proportion, LFlag flags) where ty : UnityEngine.UI.Button
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleGenButton <ty> btn = this.uiFactory.CreateButton <ty>(this.head.rect, text);

            szr.Add(btn, proportion, flags);
            return(btn);
        }
Example #2
0
        public EleGenSlider <ty> AddHorizontalSlider <ty>(float proportion, LFlag flags) where ty : UnityEngine.UI.Slider
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleGenSlider <ty> sldr = this.uiFactory.CreateHorizontalSlider <ty>(this.head.rect);

            szr.Add(sldr, proportion, flags);
            return(sldr);
        }
Example #3
0
        public EleTex AddTexture(Texture texture, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleTex img = this.uiFactory.CreateTex(this.head.rect, texture);

            szr.Add(img, proportion, flags);
            return(img);
        }
Example #4
0
        public EleButton AddButton(string text, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleButton btn = this.uiFactory.CreateButton(this.head.rect, text);

            szr.Add(btn, proportion, flags);
            return(btn);
        }
Example #5
0
        public EleText AddText(string text, bool wrap, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleText ret = this.uiFactory.CreateText(this.head.rect, text, wrap);

            szr.Add(ret, proportion, flags);
            return(ret);
        }
Example #6
0
        public EleImg AddImage(Sprite sprite, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleImg img = this.uiFactory.CreateImage(this.head.rect, sprite);

            szr.Add(img, proportion, flags);
            return(img);
        }
Example #7
0
        public EleToggle AddToggle(string label, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleToggle tog = this.uiFactory.CreateToggle(this.head.rect, label);

            szr.Add(tog, proportion, flags);
            return(tog);
        }
Example #8
0
        public EleSeparator AddHorizontalSeparator(float proportion = 0.0f)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleSeparator sep = this.uiFactory.CreateHorizontalSeparator(this.head.rect);

            szr.Add(sep, proportion, LFlag.GrowHoriz);
            return(sep);
        }
Example #9
0
        public EleSpace AddSpace(Vector2 sz, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleSpace space = new EleSpace(sz);

            szr.Add(space, proportion, flags);
            return(space);
        }
Example #10
0
        public EleSlider AddHorizontalSlider(float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleSlider sldr = this.uiFactory.CreateHorizontalSlider(this.head.rect);

            szr.Add(sldr, proportion, flags);
            return(sldr);
        }
Example #11
0
        public EleGenToggle <ty> AddToggle <ty>(string label, float proportion, LFlag flags)
            where ty : UnityEngine.UI.Toggle
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleGenToggle <ty> tog = this.uiFactory.CreateToggle <ty>(this.head.rect, label);

            szr.Add(tog, proportion, flags);
            return(tog);
        }
Example #12
0
        public EleVertScrollRgn AddVertScrollRect(float proportion, LFlag flags, string name)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleVertScrollRgn srgn =
                this.uiFactory.CreateVerticalScrollRect(this.head.rect, name);

            szr.Add(srgn, proportion, flags);
            return(srgn);
        }
Example #13
0
        public EleGridSizer AddGridSizer(int cols, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();
            EleGridSizer ret;

            if (szr == null)
            {
                ret = this.uiFactory.GridSizer(this.head.rect, cols);
            }
            else
            {
                ret = this.uiFactory.GridSizer(szr, cols, proportion, flags);
            }

            return(ret);
        }
Example #14
0
        public EleGenVertScrollRgn <RTy, STy> AddVertScrollRect <RTy, STy>(float proportion, LFlag flags, string name = "")
            where RTy : UnityEngine.UI.ScrollRect
            where STy : UnityEngine.UI.Scrollbar
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleGenVertScrollRgn <RTy, STy> srgn = this.uiFactory.CreateGenVerticalScrollRect <RTy, STy>(this.head.rect, name);

            szr.Add(srgn, proportion, flags);
            return(srgn);
        }
Example #15
0
        public EleBoxSizer AddHorizSizer(float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();
            EleBoxSizer  ret;

            if (szr == null)
            {
                ret = this.uiFactory.HorizontalSizer(this.head.rect);
            }
            else
            {
                ret = this.uiFactory.HorizontalSizer(szr, proportion, flags);
            }

            return(ret);
        }
Example #16
0
        public ElePropGrid PushPropGrid(int fontSize, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            ElePropGrid epg = this.uiFactory.CreatePropertyGrid(this.head.rect, fontSize);

            szr.Add(epg, proportion, flags);

            this.stack.Push(this.head);
            this.head = new Entry(this.head.rect, epg);

            return(epg);
        }
Example #17
0
        public EleInput AddInput(string starting, bool multiline, float proportion, LFlag flags)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleInput input = this.uiFactory.CreateInput(this.head.rect, multiline);

            if (string.IsNullOrEmpty(starting) == false)
            {
                input.input.text = starting;
            }

            szr.Add(input, proportion, flags);
            return(input);
        }
Example #18
0
        public EleHeader AddHeader(string text)
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleHeader header =
                new EleHeader(
                    this.head.rect,
                    text,
                    this.uiFactory.headerTextAttrib.font,
                    this.uiFactory.headerTextAttrib.color,
                    this.uiFactory.headerTextAttrib.fontSize,
                    this.uiFactory.headerSprite,
                    this.uiFactory.buttonPadding);

            szr.Add(header, 0.0f, LFlag.GrowHoriz);

            return(header);
        }
Example #19
0
        public EleBoxSizer HorizontalSizer(EleBaseSizer parent, float proportion, LFlag flags)
        {
            EleBoxSizer bs = new EleBoxSizer(parent, Direction.Horiz, proportion, flags);

            return(bs);
        }
Example #20
0
 public EleBaseSizer(EleBaseSizer parent, float proportion, LFlag flags, string name = "")
     : base(name)
 {
     parent.Add(this, proportion, flags);
 }
Example #21
0
 public UILStack(Factory factory, EleBaseRect rect, EleBaseSizer sizer)
 {
     this.uiFactory = factory;
     this.head      = new Entry(rect, sizer);
 }
Example #22
0
 public void SetSizer(EleBaseSizer sz)
 {
     this.sizer = sz;
 }
Example #23
0
 public Entry(EleBaseRect rect)
 {
     this.rect  = rect;
     this.sizer = null;
 }
Example #24
0
 public Entry(EleBaseRect rect, EleBaseSizer sizer)
 {
     this.rect  = rect;
     this.sizer = sizer;
 }
Example #25
0
        public EleBoxSizer VerticalSizer(EleBaseSizer parent, float proportion, LFlag flags)
        {
            EleBoxSizer bs = new EleBoxSizer(parent, Direction.Vert, proportion, flags);

            return(bs);
        }
Example #26
0
 public EleBoxSizer(EleBaseSizer parent, Direction direction, float proportion, LFlag flags, string name = "")
     : base(parent, proportion, flags, name)
 {
     this.direction = direction;
 }
Example #27
0
        public EleGridSizer GridSizer(EleBaseSizer parent, int cols, float proportion, LFlag flags)
        {
            EleGridSizer gs = new EleGridSizer(parent, cols, proportion, flags);

            return(gs);
        }
Example #28
0
 public EleGridSizer(EleBaseSizer parent, int col, float proportion, LFlag flags, string name = "")
     : base(parent, proportion, flags, name)
 {
     this.columns = col;
 }