Ejemplo n.º 1
0
 public void update(double dt)
 {
     if (hasStripe)
     {
         stripe.update(dt);
     }
     if (stack.Count > 0)
     {
         UiElement top = stack[stack.Count - 1];
         top.update(dt);
         while (stack.Count > 0 && stack[stack.Count - 1].finished)
         {
             stack.RemoveAt(stack.Count - 1);
             locations.RemoveAt(locations.Count - 1);
         }
     }
 }
Ejemplo n.º 2
0
 public void addElement(UiElement element, StripePosition location)
 {
     if (location == StripePosition.Left)
     {
         leftElement = element;
         stripeLeft  = new Vector2(0, STRIPE_START);
     }
     else if (location == StripePosition.Right)
     {
         rightElement = element;
         stripeRight  = new Vector2(Game1.INTERNAL_WIDTH - rightElement.size.X, STRIPE_START);
     }
     else if (location == StripePosition.Center)
     {
         centerElement = element;
         stripeCenter  = new Vector2(Math.Max(0, (int)(Game1.INTERNAL_WIDTH - centerElement.size.X) / 2),
                                     Math.Max(STRIPE_START, (int)(Game1.INTERNAL_HEIGHT - centerElement.size.Y) / 2));
     }
 }
Ejemplo n.º 3
0
 public void pushElement(UiElement element, Vector2 location)
 {
     element.setUiSystem(this);
     stack.Add(element);
     locations.Add(location);
 }