1
0
mirror of synced 2024-12-13 16:21:10 +01:00
Switch-Toolbox/Switch_Toolbox_Library/Animations/AnimationRewrite/STAnimation.cs

93 lines
2.2 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
2020-05-10 17:44:52 +02:00
using System.Windows.Forms;
using Toolbox.Library.Forms;
namespace Toolbox.Library.Animations
{
public enum STInterpoaltionType
{
Constant,
Step,
Linear,
Hermite,
2020-03-10 01:27:56 +01:00
Bezier,
Bitmap,
}
/// <summary>
/// Represents how a track is played after it reaches end frame.
/// Repeat repeats back from the start.
/// Mirror goes from the end frame to the start
/// </summary>
public enum STLoopMode
{
Repeat,
Mirror,
Clamp,
}
/// <summary>
2020-01-17 03:04:02 +01:00
/// Represents a class for animating
/// </summary>
2020-05-10 17:44:52 +02:00
public class STAnimation
{
/// <summary>
/// The name of the animation.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The frame to start playing the animation.
/// </summary>
public float StartFrame { get; set; }
/// <summary>
/// The current frame of the animation.
/// </summary>
public float Frame { get; set; }
/// <summary>
/// The total amount of frames to play in the animation.
/// </summary>
public float FrameCount { get; set; }
/// <summary>
/// Whether the animation will loop or not after
/// the playback rearches the total frame count.
/// </summary>
public bool Loop { get; set; }
/// <summary>
/// The step value when a frame advances.
/// </summary>
public float Step { get; set; }
/// <summary>
/// A list of groups that store the animation data.
/// </summary>
public List<STAnimGroup> AnimGroups = new List<STAnimGroup>();
public void SetFrame(float frame)
{
Frame = frame;
}
public virtual void NextFrame()
{
if (Frame < StartFrame || Frame > FrameCount) return;
}
/// <summary>
/// Resets the animation group values
/// This should clear values from tracks, or reset them to base values.
/// </summary>
public virtual void Reset()
{
}
}
}