Modify MenuCursor hightlight animation

This commit is contained in:
ekrctb 2018-07-02 16:28:05 +09:00
parent e37b931a55
commit f9f192ce34
1 changed files with 9 additions and 12 deletions

View File

@ -67,12 +67,16 @@ protected override bool OnMouseMove(InputState state)
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
// only trigger animation for main mouse buttons
if (args.Button <= MouseButton.Right)
{
ActiveCursor.Scale = new Vector2(1);
ActiveCursor.ScaleTo(0.90f, 800, Easing.OutQuint);
((Cursor)ActiveCursor).AdditiveLayer.Alpha = 0;
((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, Easing.OutQuint);
}
if (args.Button == MouseButton.Left && cursorRotate)
{
@ -86,7 +90,7 @@ protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
if (!state.Mouse.HasMainButtonPressed)
{
((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, Easing.OutQuint);
((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint);
ActiveCursor.ScaleTo(1, 500, Easing.OutElastic);
}
@ -99,13 +103,6 @@ protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
return base.OnMouseUp(state, args);
}
protected override bool OnClick(InputState state)
{
((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint);
return base.OnClick(state);
}
protected override void PopIn()
{
ActiveCursor.FadeTo(1, 250, Easing.OutQuint);