mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
// 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.Framework.Input.Events;
|
|
using osu.Game.Rulesets.Edit;
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
using osuTK;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles
|
|
{
|
|
public class HitCirclePlacementBlueprint : PlacementBlueprint
|
|
{
|
|
public new HitCircle HitObject => (HitCircle)base.HitObject;
|
|
|
|
private readonly HitCirclePiece circlePiece;
|
|
|
|
public HitCirclePlacementBlueprint()
|
|
: base(new HitCircle())
|
|
{
|
|
InternalChild = circlePiece = new HitCirclePiece();
|
|
}
|
|
|
|
protected override bool OnClick(ClickEvent e)
|
|
{
|
|
HitObject.StartTime = EditorClock.CurrentTime;
|
|
EndPlacement();
|
|
return true;
|
|
}
|
|
|
|
public override void UpdatePosition(Vector2 screenSpacePosition)
|
|
{
|
|
HitObject.Position = ToLocalSpace(screenSpacePosition);
|
|
}
|
|
}
|
|
}
|