예제 #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);
     }
 }
예제 #2
0
 public override void Enter()
 {
     for (int i = 0; i < children.Count(); i++)
     {
         ZObject child = children[i];
         child.Enter();
     }
 }
예제 #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);
     }
 }
예제 #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();
     }
 }
예제 #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);
     }
 }
예제 #6
0
 public static void YZ(ZObject target, Vector2 position) => target.z = position.Y + target.depthYOffset;
예제 #7
0
 public void RemoveChild(ZObject child)
 {
     children.Remove(child);
 }
예제 #8
0
 /// <summary>
 /// Add a ZObject to this group.
 /// </summary>
 /// <param name="child"></param>
 public void AddChild(ZObject child)
 {
     children.Add(child);
 }