2019-10-08 18:08:23 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Compose.Components
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-01-20 23:53:59 +08:00
|
|
|
/// An event which occurs when a <see cref="OverlaySelectionBlueprint"/> is moved.
|
2019-10-08 18:08:23 +08:00
|
|
|
/// </summary>
|
|
|
|
public class MoveSelectionEvent
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-01-21 17:01:10 +08:00
|
|
|
/// The <see cref="SelectionBlueprint"/> that triggered this <see cref="MoveSelectionEvent"/>.
|
2019-10-08 18:08:23 +08:00
|
|
|
/// </summary>
|
2020-01-21 17:01:10 +08:00
|
|
|
public readonly SelectionBlueprint Blueprint;
|
2019-10-08 18:08:23 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The starting screen-space position of the hitobject.
|
|
|
|
/// </summary>
|
|
|
|
public readonly Vector2 ScreenSpaceStartPosition;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The expected screen-space position of the hitobject at the current cursor position.
|
|
|
|
/// </summary>
|
|
|
|
public readonly Vector2 ScreenSpacePosition;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The distance between <see cref="ScreenSpacePosition"/> and the hitobject's current position, in the coordinate-space of the hitobject's parent.
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// This does not use <see cref="ScreenSpaceStartPosition"/> and does not represent the cumulative movement distance.
|
|
|
|
/// </remarks>
|
|
|
|
public readonly Vector2 InstantDelta;
|
|
|
|
|
2020-01-21 17:01:10 +08:00
|
|
|
public MoveSelectionEvent(SelectionBlueprint blueprint, Vector2 screenSpaceStartPosition, Vector2 screenSpacePosition)
|
2019-10-08 18:08:23 +08:00
|
|
|
{
|
|
|
|
Blueprint = blueprint;
|
|
|
|
ScreenSpaceStartPosition = screenSpaceStartPosition;
|
|
|
|
ScreenSpacePosition = screenSpacePosition;
|
|
|
|
|
2020-01-21 17:01:10 +08:00
|
|
|
InstantDelta = Blueprint.GetInstantDelta(ScreenSpacePosition);
|
2019-10-08 18:08:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|