Beispiel #1
0
 public void addStripeElement(UiElement element, StripePosition location)
 {
     if (hasStripe)
     {
         stripe.addElement(element, location);
     }
 }
Beispiel #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));
     }
 }