Example #1
0
 /// <summary>
 /// Call Draw() on the children
 /// </summary>
 public override void Draw(SpriteBatch batch)
 {
     for (int i = 0; i < children.Count(); i++)
     {
         ZObject child = children[i];
         child.Draw(batch);
     }
 }
Example #2
0
 public override void Enter()
 {
     for (int i = 0; i < children.Count(); i++)
     {
         ZObject child = children[i];
         child.Enter();
     }
 }
Example #3
0
 /// <summary>
 /// Call Update() on the children
 /// </summary>
 public override void Update(GameTime gameTime)
 {
     for (int i = 0; i < children.Count(); i++)
     {
         ZObject child = children[i];
         child.Update(gameTime);
     }
 }
Example #4
0
 /// <summary>
 /// Call LoadContent() on the children
 /// </summary>
 public override void LoadContent()
 {
     for (int i = 0; i < children.Count(); i++)
     {
         ZObject child = children[i];
         child.LoadContent();
     }
 }
Example #5
0
 private static int InternalSorter(ZObject a, ZObject b)
 {
     if (a.z > b.z)
     {
         return(1);
     }
     else if (a.z < b.z)
     {
         return(-1);
     }
     else
     {
         return(0);
     }
 }
Example #6
0
 public static void YZ(ZObject target, Vector2 position) => target.z = position.Y + target.depthYOffset;
Example #7
0
 public void RemoveChild(ZObject child)
 {
     children.Remove(child);
 }
Example #8
0
 /// <summary>
 /// Add a ZObject to this group.
 /// </summary>
 /// <param name="child"></param>
 public void AddChild(ZObject child)
 {
     children.Add(child);
 }