1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-28 03:15:08 +08:00

Make osu tooltips move smoothly

This commit is contained in:
Thomas Müller 2017-06-05 12:59:29 +02:00
parent 0afb188cde
commit e92c1210d1
2 changed files with 16 additions and 1 deletions

@ -1 +1 @@
Subproject commit c76d8b811b93d0c0862f342ebbab70a461006e13 Subproject commit 925bbe42bab95078b9d33189205b5b1b76bf8e01

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
@ -24,6 +25,7 @@ namespace osu.Game.Graphics.Cursor
{ {
private readonly Box background; private readonly Box background;
private readonly OsuSpriteText text; private readonly OsuSpriteText text;
private bool firstMovement = true;
public override string TooltipText public override string TooltipText
{ {
@ -88,6 +90,19 @@ namespace osu.Game.Graphics.Cursor
using (BeginDelayedSequence(150)) using (BeginDelayedSequence(150))
FadeOut(500, EasingTypes.OutQuint); FadeOut(500, EasingTypes.OutQuint);
} }
public override void Move(Vector2 pos)
{
if (firstMovement)
{
Position = pos;
firstMovement = false;
}
else
{
MoveTo(pos, 200, EasingTypes.OutQuint);
}
}
} }
} }
} }