2017-08-04 19:22:53 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Timing
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2017-08-07 16:25:40 +08:00
|
|
|
|
/// A <see cref="ScrollingContainer"/> which scrolls linearly relative to the <see cref="MultiplierControlPoint"/> start time.
|
2017-08-04 19:22:53 +08:00
|
|
|
|
/// </summary>
|
2017-11-21 10:49:42 +08:00
|
|
|
|
public class LinearScrollingContainer : ScrollingContainer
|
2017-08-04 19:22:53 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly MultiplierControlPoint controlPoint;
|
|
|
|
|
|
2017-08-22 17:37:49 +08:00
|
|
|
|
public LinearScrollingContainer(MultiplierControlPoint controlPoint)
|
2017-08-04 19:22:53 +08:00
|
|
|
|
{
|
|
|
|
|
this.controlPoint = controlPoint;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2017-08-22 17:37:49 +08:00
|
|
|
|
if ((ScrollingAxes & Axes.X) > 0) X = (float)(controlPoint.StartTime - Time.Current);
|
|
|
|
|
if ((ScrollingAxes & Axes.Y) > 0) Y = (float)(controlPoint.StartTime - Time.Current);
|
2017-08-04 19:22:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|