Ejemplo n.º 1
0
        public void LoadContent(Sprite sprite)
        {
            if (sprite == null)
            {
                throw new ArgumentNullException("sprite");
            }

            _sprite = sprite; 
        }
Ejemplo n.º 2
0
 public TexturedButton(Sprite sprite, RectangleF area)
     : base(area)
 {
     this.Sprite = sprite;
     _visualArea = area.ToRectangle(RoundingOptions.Round);
 }
Ejemplo n.º 3
0
 public TexturedButton(Sprite sprite, Vector2 centerPosition, GenericEvent clicked)
     : this(sprite, new RectangleF(centerPosition.X - sprite.Width / 2f * sprite.Scale.X, centerPosition.Y - sprite.Height / 2f * sprite.Scale.Y, sprite.Width * sprite.Scale.Y, sprite.Height * sprite.Scale.Y))
 {
     this.Click += clicked;
 }
Ejemplo n.º 4
0
 public TexturedButton(Sprite sprite, Vector2 centerPosition)
     : this(sprite, new RectangleF(centerPosition.X - sprite.Width / 2f * sprite.Scale.X, centerPosition.Y - sprite.Height / 2f * sprite.Scale.Y, sprite.Width * sprite.Scale.Y, sprite.Height * sprite.Scale.Y))
 {
 }
Ejemplo n.º 5
0
 public TexturedButton(RectangleF area, Sprite sprite)
     : base(area)
 {
     this.Sprite = sprite;
 }
Ejemplo n.º 6
0
 public TexturedButton(Vector2 centerPosition, Sprite sprite)
     : this(new RectangleF(centerPosition.X - sprite.Texture.Width / 2f * sprite.Scale.X, centerPosition.Y - sprite.Texture.Height / 2f * sprite.Scale.Y, sprite.Texture.Width * sprite.Scale.Y, sprite.Texture.Height * sprite.Scale.Y), sprite)
 {
 }