Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
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);
        }
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }
Beispiel #9
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);
        }
Beispiel #10
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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #13
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);
        }
Beispiel #14
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);
        }
Beispiel #15
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);
        }
Beispiel #16
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);
        }
 public EleBaseSizer(EleBaseSizer parent, float proportion, LFlag flags, string name = "")
     : base(name)
 {
     parent.Add(this, proportion, flags);
 }