/// <summary> /// Loads the frames of the animation /// </summary> /// <param name="framesStruct">Struct containing the array with the textures for each frame</param> public void LoadFrames(IAnimationFrames framesStruct) { SpriteAnimationFrames animationFrames = (SpriteAnimationFrames)framesStruct; frames = animationFrames.frames; currentFrame.Texture = frames[0]; currentFrame.DrawArea = new Rectangle(0, 0, currentFrame.Texture.Width, currentFrame.Texture.Height); frameIndex = 0; }
/// <summary> /// Loads the frames of the animation /// </summary> /// <param name="framesStruct">Struct containing all the information needed to load the frames</param> public void LoadFrames(IAnimationFrames frames) { SpritesheetAnimationFrames animationFrames = (SpritesheetAnimationFrames)frames; currentFrame.Texture = animationFrames.spriteSheet; currentFrame.DrawArea = animationFrames.drawAreas[0]; currentFrame.origin = animationFrames.origin; drawAreas = animationFrames.drawAreas; frameIndex = 0; }