Make circle piece respond to hitobject scale

This commit is contained in:
smoogipoo 2018-10-26 15:26:19 +09:00
parent 4a507c66ee
commit 22c545ea8c
3 changed files with 17 additions and 1 deletions

View File

@ -28,6 +28,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Masks.HitCircleMasks.Components
hitCircle.PositionChanged += _ => UpdatePosition();
hitCircle.StackHeightChanged += _ => UpdatePosition();
hitCircle.ScaleChanged += _ => Scale = new Vector2(hitCircle.Scale);
}
[BackgroundDependencyLoader]

View File

@ -62,6 +62,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
HitObject.PositionChanged += _ => Position = HitObject.StackedPosition;
HitObject.StackHeightChanged += _ => Position = HitObject.StackedPosition;
HitObject.ScaleChanged += s => Scale = new Vector2(s);
}
public override Color4 AccentColour

View File

@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Osu.Objects
public event Action<Vector2> PositionChanged;
public event Action<int> StackHeightChanged;
public event Action<float> ScaleChanged;
public double TimePreempt = 600;
public double TimeFadeIn = 400;
@ -64,7 +65,20 @@ namespace osu.Game.Rulesets.Osu.Objects
public double Radius => OBJECT_RADIUS * Scale;
public float Scale { get; set; } = 1;
private float scale = 1;
public float Scale
{
get => scale;
set
{
if (scale == value)
return;
scale = value;
ScaleChanged?.Invoke(value);
}
}
public virtual bool NewCombo { get; set; }