Gered
10e057953e
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.
39 lines
974 B
C#
39 lines
974 B
C#
using System;
|
|
|
|
namespace Gwen.Anim.Size
|
|
{
|
|
class Width : TimedAnimation
|
|
{
|
|
private int m_StartSize;
|
|
private int m_Delta;
|
|
private bool m_Hide;
|
|
|
|
public Width(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.Width = m_StartSize;
|
|
}
|
|
|
|
protected override void Run(float delta)
|
|
{
|
|
base.Run(delta);
|
|
m_Control.Width = (int)Math.Round(m_StartSize + (m_Delta * delta));
|
|
}
|
|
|
|
protected override void OnFinish()
|
|
{
|
|
base.OnFinish();
|
|
m_Control.Width = m_StartSize + m_Delta;
|
|
m_Control.IsHidden = m_Hide;
|
|
}
|
|
}
|
|
}
|