Esempio n. 1
0
        /// <summary>
        /// Prepare the sprite for animation.
        /// </summary>
        /// <param name="width">width of a sprite on the spritesheet</param>
        /// <param name="height">height of a sprite on the spritesheet</param>
        public void PrepareAnimation(int width, int height)
        {
            _animator.Initialize(width, height, _texture.Width, _texture.Height);

            // The sprite size is now the size of a sprite on the spritesheet
            _rectangle = new Rectangle((int)X, (int)Y, width, height);

            _hasAnimation = true;
        }