2019-10-08 10:08:23 +00: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 15:53:59 +00:00
|
|
|
/// An event which occurs when a <see cref="OverlaySelectionBlueprint"/> is moved.
|
2019-10-08 10:08:23 +00:00
|
|
|
/// </summary>
|
|
|
|
public class MoveSelectionEvent
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-01-21 09:01:10 +00:00
|
|
|
/// The <see cref="SelectionBlueprint"/> that triggered this <see cref="MoveSelectionEvent"/>.
|
2019-10-08 10:08:23 +00:00
|
|
|
/// </summary>
|
2020-01-21 09:01:10 +00:00
|
|
|
public readonly SelectionBlueprint Blueprint;
|
2019-10-08 10:08:23 +00:00
|
|
|
|
|
|
|
/// <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>
|
|
|
|
public readonly Vector2 InstantDelta;
|
|
|
|
|
2020-01-22 12:37:57 +00:00
|
|
|
public MoveSelectionEvent(SelectionBlueprint blueprint, Vector2 screenSpacePosition)
|
2019-10-08 10:08:23 +00:00
|
|
|
{
|
|
|
|
Blueprint = blueprint;
|
|
|
|
ScreenSpacePosition = screenSpacePosition;
|
|
|
|
|
2020-01-21 09:01:10 +00:00
|
|
|
InstantDelta = Blueprint.GetInstantDelta(ScreenSpacePosition);
|
2019-10-08 10:08:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|