public void PushScene(Node scene) { this._scenesStack.Add(scene); this.RunningScene = scene; }
public void RunWithScene(Node scene) { if (this._scenesStack.Count > 0) this.PopScene(); this.PushScene(scene); }
protected void internalRemoveChild(Node child, bool dispose) { child.Parent = null; if (dispose == true) child.Dispose(); this.Children.Remove(child); }
protected void internalAddChild(Node node, int zOrder) { if (this.Children == null) this.Children = new List<Node>(); Node last = this.Children.Count > 0 ? this.Children[this.Children.Count - 1] : null; if (last == null || last.ZOrder <= zOrder) { this.Children.Add(node); } else { int index = 0; foreach (Node child in this.Children) { if (child.ZOrder > zOrder) { this.Children.Insert(index, node); break; } ++index; } } node.ZOrder = zOrder; }
public virtual void ReorderChild(Node child, int zOrder) { this.Children.Remove(child); this.internalAddChild(child, zOrder); }
public virtual void RemoveChild(Node child, bool dispose) { this.internalRemoveChild(child, dispose); }
public virtual void AddChild(Node child, int zOrder = 0, int id = 0) { if (child.Parent != null) throw new Exception("child is already added."); this.internalAddChild(child, zOrder); child.ID = id; child.Parent = this; }