예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="XnaAnimation" /> class.
        /// </summary>
        /// <param name="anim">The animation to use the data to load.</param>
        /// <param name="texturecache">The texture cache used to load the textures..</param>
        public XnaAnimation(Animation anim, TextureCache texturecache)
            : base(anim.ID, anim.IsLooping, anim.ResetIndex, new List<Frame>(), anim.CurrentFrame, anim.TimingIndex)
        {
            foreach (var frame in anim.GetFramesList()) //Convert SOL Frame to XNA Frame.
            {
                AddFrame(frame.ToXnaFrame());
            }

            if (texturecache != null)
            {
                LoadContent(texturecache);
            }
        }