public virtual void AddChild(Widget child) { _children.Add(child); child.Parent = this; child.SpriteSheet = SpriteSheet; FindRoot().UpdateLayout(); child.UpdateNames(); }
public Widget(string name, float x = 0, float y = 0, float w = 0, float h = 0, bool expandable = true, Alignment? align = null) { _name = name; _x = x; _y = y; _w = w; _h = h; PreferredSize = Vector2.Zero; Parent = null; SpriteSheet = null; Visible = true; Alignment = align ?? Alignment.Centered; Expandable = expandable; }
public virtual void InsertChild(int index, Widget child) { _children.Insert(index, child); }
public virtual void RemoveChild(Widget child) { child.RemoveNames(); _children.Remove(child); child.Parent = null; FindRoot().UpdateLayout(); }
public override void AddChild(Widget child) { RemoveAllChildren(); base.AddChild(child); }