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); }
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); }
public EleGenButton <ty> PushButton <ty>(string text, float proportion, LFlag flags) where ty : UnityEngine.UI.Button { EleGenButton <ty> ret = this.AddButton <ty>(text, proportion, flags); if (ret == null) { return(null); } this.stack.Push(this.head); this.head = new Entry(ret); return(ret); }
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); }
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); }
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); }
public EleTex PushTexture(Texture texture, float proportion, LFlag flags) { EleTex ret = this.AddTexture(texture, proportion, flags); if (ret == null) { return(null); } this.stack.Push(this.head); this.head = new Entry(ret); return(ret); }
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); }
public EleImg PushImage(Sprite sprite, float proportion, LFlag flags) { EleImg ret = this.AddImage(sprite, proportion, flags); if (ret == null) { return(null); } this.stack.Push(this.head); this.head = new Entry(ret); return(ret); }
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); }
public EleVertScrollRgn PushVertScrollRect(float proportion, LFlag flags, string name = "") { EleVertScrollRgn ret = this.AddVertScrollRect(proportion, flags, name); if (ret == null) { return(null); } this.stack.Push(this.head); this.head = new Entry(ret); return(ret); }
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); }
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); }
public EleButton PushButton(string text, float proportion, LFlag flags) { EleButton ret = this.AddButton(text, proportion, flags); if (ret == null) { return(null); } this.stack.Push(this.head); this.head = new Entry(ret); return(ret); }
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); }
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); }
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); }
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); }
public EleGridSizer PushGridSizer(int cols, float proportion, LFlag flags) { EleGridSizer szr = this.AddGridSizer(cols, proportion, flags); if (szr == null) { return(null); } Entry newE = new Entry(this.head.rect, szr); this.stack.Push(this.head); this.head = newE; return(szr); }
public EleBoxSizer PushVertSizer(float proportion, LFlag flags) { EleBoxSizer szr = this.AddVertSizer(proportion, flags); if (szr == null) { return(null); } Entry newE = new Entry(this.head.rect, szr); this.stack.Push(this.head); this.head = newE; return(szr); }
public static LFlag GetFinalFlags(LFlag orig, bool collapsed) { if (collapsed == true) { if ((orig & LFlag.GrowHorizOnCollapse) != 0) { orig |= LFlag.GrowHoriz; } if ((orig & LFlag.GrowVertOnCollapse) != 0) { orig |= LFlag.GrowVert; } } return(orig); }
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); }
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); }
Vector2 ImplCalcMinSize_Vert( Dictionary <Ele, Vector2> cache, Dictionary <Ele, float> widths, float width, bool collapsable) { Vector2 ret = Vector2.zero; width -= this.border.width; bool atleastOne = false; foreach (PairedLayoutData pld in this.entries) { if (atleastOne == false) { ret.y += this.padding; } Vector2 sz; LFlag pldFlag = GetFinalFlags(pld.style, collapsable); if ((pldFlag & LFlag.GrowHoriz) != 0) { sz = pld.ele.GetMinSize(cache, widths, width, collapsable); } else { sz = pld.ele.GetMinSize(cache, widths, pld.ele.GetMinWidth(widths), collapsable); } ret.x = Mathf.Max(sz.x, ret.x); ret.y += sz.y; } ret.y += this.border.height; ret.x += this.border.width; return(ret); }
public void Add(Ele child, float proportion, LFlag flags, string label) { PairedLayoutData pld = new PairedLayoutData(); pld.ele = child; pld.prop = proportion; pld.style = flags; pld.label = label; if (string.IsNullOrEmpty(label) == false) { RTQuick.CreateGameObjectWithText( parent.GetContentRect(), "Label_" + label, out pld.labelText).TopLeftAnchorsPivot(); this.labelText.Apply(pld.labelText); pld.labelText.text = label; pld.labelText.horizontalOverflow = HorizontalWrapMode.Overflow; pld.labelText.verticalOverflow = VerticalWrapMode.Overflow; } layoutData.Add(pld); }
public override void Add(Ele child, float proportion, LFlag flags) { this.Add(child, proportion, flags, ""); }
public EleGridSizer GridSizer(EleBaseSizer parent, int cols, float proportion, LFlag flags) { EleGridSizer gs = new EleGridSizer(parent, cols, proportion, flags); return(gs); }
public EleBoxSizer VerticalSizer(EleBaseSizer parent, float proportion, LFlag flags) { EleBoxSizer bs = new EleBoxSizer(parent, Direction.Vert, proportion, flags); return(bs); }
public EleBoxSizer HorizontalSizer(EleBaseSizer parent, float proportion, LFlag flags) { EleBoxSizer bs = new EleBoxSizer(parent, Direction.Horiz, proportion, flags); return(bs); }
public EleSpace AddVertSpace(float height, float proportion, LFlag flags) { return(this.AddSpace(new Vector2(0.0f, height), proportion, flags)); }