This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
gwen-dotnet/Gwen/Anim/Size/Height.cs
Gered 10e057953e initial commit
Contains changes from "gwen-dotnet" removing dependancies on Windows,
which ultimately means certain features (e.g. file load/save dialogs)
do not work. Those classes still exist, but the code has been commented
out.
2013-03-28 18:47:01 -04:00

39 lines
969 B
C#

using System;
namespace Gwen.Anim.Size
{
class Height : TimedAnimation
{
private int m_StartSize;
private int m_Delta;
private bool m_Hide;
public Height(int startSize, int endSize, float length, bool hide = false, float delay = 0.0f, float ease = 1.0f)
: base(length, delay, ease)
{
m_StartSize = startSize;
m_Delta = endSize - m_StartSize;
m_Hide = hide;
}
protected override void OnStart()
{
base.OnStart();
m_Control.Height = m_StartSize;
}
protected override void Run(float delta)
{
base.Run(delta);
m_Control.Height = (int)(m_StartSize + (m_Delta * delta));
}
protected override void OnFinish()
{
base.OnFinish();
m_Control.Height = m_StartSize + m_Delta;
m_Control.IsHidden = m_Hide;
}
}
}