mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 03:53:20 +08:00
Make osu tooltips move smoothly
This commit is contained in:
parent
0afb188cde
commit
e92c1210d1
@ -1 +1 @@
|
|||||||
Subproject commit c76d8b811b93d0c0862f342ebbab70a461006e13
|
Subproject commit 925bbe42bab95078b9d33189205b5b1b76bf8e01
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user