public override void Update(Mouse mouse = null, int?pointX = null, int?pointY = null) { DownAnimation?.Tick(); UpAnimation?.Tick(); if (DownAnimation.Counter.State == TimerState.Started) { Texture.ScaleX = Texture.ScaleY = (float)(DownAnimation.GetAnimation() / 100); } else if (UpAnimation.Counter.State == TimerState.Started) { Texture.ScaleX = Texture.ScaleY = (float)(UpAnimation.GetAnimation() / 100); } else { if (LongClickCounter.State == TimerState.Started) { Texture.ScaleX = Texture.ScaleY = 0.95f; } else { Texture.ScaleX = Texture.ScaleY = 1.0f; } } base.Update(mouse, pointX, pointY); }
private void Button_OnMouseUp(object sender, EventArgs e) { DownAnimation.Stop(); DownAnimation.Reset(); UpAnimation.Start(); }