Example #1
0
 public void Draw(Sprite sprite, Int32 x, Int32 y, Rectangle sourceRect)
 {
     Graphics.DrawImage(sprite.Image, x, y, sourceRect, GraphicsUnit.Pixel);
 }
Example #2
0
 public void AddSprite(Sprite sprite)
 {
     Sprites.Add(sprite);
 }
Example #3
0
 public virtual void Draw(Sprite sprite, Int32 x, Int32 y)
 {
     Graphics.DrawImage(sprite.Image, x, y);
 }
Example #4
0
        internal Boolean OnMouseMove(MouseEventArgs e)
        {
            foreach (var sprite in Sprites)
            {
                if (sprite.IsInRect(e.Location.X, e.Location.Y) == true)
                {
                    if (_hoverSprite != null &&
                        _hoverSprite != sprite)
                        _hoverSprite.OnMouseLeave();

                    _hoverSprite = sprite;
                }

                if (sprite.OnMouseMove(e) == true)
                    return true;
            }

            if (MouseMove != null)
            {
                MouseMove(this, e);
                return true;
            }

            return false;
        }