public void AddBefore() { if (BeforePseudo != null) { return; } BeforePseudo = new TextComponent("", Context, "_before"); BeforePseudo.IsPseudoElement = true; BeforePseudo.GameObject.name = "[Before]"; BeforePseudo.SetParent(this, Children.FirstOrDefault()); }
public TextComponent(TextComponent linkedTo) : this(null, linkedTo.Context) { Layout.CopyStyle(linkedTo.Layout); Style.CopyStyle(linkedTo.Style); SetParent(linkedTo.Parent, linkedTo, true); ApplyLayoutStyles(); ApplyStyles(); ScheduleLayout(); }
public void AddAfter() { if (AfterPseudo != null) { return; } var tc = new TextComponent("", Context, "_after"); AfterPseudo = tc; tc.IsPseudoElement = true; tc.GameObject.name = "[After]"; tc.SetParent(this, Children.LastOrDefault(), true); }
public TextComponent(TextComponent linkedTo) : this(null, linkedTo.Context, "") { Layout.CopyStyle(linkedTo.Layout); ComputedStyle.CopyStyle(linkedTo.ComputedStyle); Style = linkedTo.Style; Style.changed += StyleChanged; SetParent(linkedTo.Parent, linkedTo, true); ApplyLayoutStyles(); ApplyStyles(); ScheduleLayout(); }