/// <summary> /// Adds a child, but does not change its Layer /// </summary> /// <param name="object2d">The parent 2D Object</param> public void AddChild(Object2D object2d) { Children.Add(object2d); object2d.Parent = this; object2d.CalcTransform(); if (ChildAdded != null) { ChildAdded(object2d); } }
/// <summary> /// Adds a child and changes its layer to the parent's /// </summary> /// <param name="object2d">The parent 2D Object</param> /// <param name="SubLayer">The sub-layer of the child to the parent</param> public void AddChild(Object2D object2d, int SubLayer) { Children.Add(object2d); object2d.Parent = this; object2d.Layer = Layer + (SubLayer / 1000); object2d.CalcTransform(); if (ChildAdded != null) { ChildAdded(object2d); } }