diff --git a/LemonUI/Elements/ScaledAnim.cs b/LemonUI/Elements/ScaledAnim.cs
index a27a5b3..5706760 100644
--- a/LemonUI/Elements/ScaledAnim.cs
+++ b/LemonUI/Elements/ScaledAnim.cs
@@ -17,11 +17,10 @@ namespace LemonUI.Elements
///
/// A scaled animation using YTD files with all of the frames.
///
- public class ScaledAnim : BaseElement
+ public class ScaledAnim : ScaledTexture
{
#region Fields
- private readonly ScaledTexture texture = new ScaledTexture(string.Empty, string.Empty);
private float frameRate;
private int start = 0;
private int duration;
@@ -30,46 +29,6 @@ public class ScaledAnim : BaseElement
#region Properties
- ///
- /// The position of this animation.
- ///
- public override PointF Position
- {
- get => texture.Position;
- set => texture.Position = value;
- }
- ///
- /// The size of this animation.
- ///
- public override SizeF Size
- {
- get => texture.Size;
- set => texture.Size = value;
- }
- ///
- /// The color of this animation.
- ///
- public override Color Color
- {
- get => texture.Color;
- set => texture.Color = value;
- }
- ///
- /// The rotation of this animation.
- ///
- public override float Heading
- {
- get => texture.Heading;
- set => texture.Heading = value;
- }
- ///
- /// The dictionary that contains the textures.
- ///
- public string Dictionary
- {
- get => texture.Dictionary;
- set => texture.Dictionary = value ?? throw new ArgumentNullException(nameof(value));
- }
///
/// The total number of frames per second.
///
@@ -121,7 +80,6 @@ public ScaledAnim(string dict) : this(dict, PointF.Empty, SizeF.Empty)
/// The size of the animation.
public ScaledAnim(string dict, SizeF size) : this(dict, PointF.Empty, size)
{
- texture.Dictionary = dict ?? throw new ArgumentNullException(nameof(dict));
}
///
/// Creates a new dictionary based animation.
@@ -129,9 +87,9 @@ public ScaledAnim(string dict, SizeF size) : this(dict, PointF.Empty, size)
/// The texture dictionary (YTD) to use.
/// The position of the animation.
/// The size of the animation.
- public ScaledAnim(string dict, PointF pos, SizeF size) : base(pos, size)
+ public ScaledAnim(string dict, PointF pos, SizeF size) : base(pos, size, dict, string.Empty)
{
- texture.Dictionary = dict ?? throw new ArgumentNullException(nameof(dict));
+ Dictionary = dict ?? throw new ArgumentNullException(nameof(dict));
}
#endregion
@@ -168,9 +126,9 @@ public override void Draw()
float progress = (time - (float)start) / Duration;
int totalFrames = (int)((duration / 1000.0f) * frameRate);
int currentFrame = (int)(totalFrames * progress);
- texture.Texture = currentFrame.ToString();
+ Texture = currentFrame.ToString();
- texture.Draw();
+ base.Draw();
}
#endregion