mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 07:32:55 +08:00
Add a tween when clicking to seek
This commit is contained in:
parent
3f702d13a3
commit
5942072128
@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.MathUtils;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -107,9 +108,17 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override void UpdateValue(float value)
|
||||
{
|
||||
var xFill = value * UsableWidth;
|
||||
fill.Width = xFill;
|
||||
handleBase.X = xFill;
|
||||
// handled in update
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
float newX = (float)Interpolation.Lerp(handleBase.X, NormalizedValue * UsableWidth, Time.Elapsed / 40);
|
||||
|
||||
fill.Width = newX;
|
||||
handleBase.X = newX;
|
||||
}
|
||||
|
||||
protected override void OnUserChange(double value) => OnSeek?.Invoke(value);
|
||||
|
Loading…
Reference in New Issue
Block a user