mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Combine DisplayRadius and Scale to DisplaySize
This commit is contained in:
@ -21,7 +21,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
public Bindable<Color4> AccentColour { get; } = new Bindable<Color4>();
|
||||
public Bindable<bool> HyperDash { get; } = new Bindable<bool>();
|
||||
|
||||
float IHasCatchObjectState.Scale => Scale.X;
|
||||
public Vector2 DisplaySize => Size * Scale;
|
||||
|
||||
public float DisplayRotation => Rotation;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this hit object should stay on the catcher plate when the object is caught by the catcher.
|
||||
@ -45,8 +47,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
public virtual void CopyStateFrom(IHasCatchObjectState objectState)
|
||||
{
|
||||
HitObject = objectState.HitObject;
|
||||
Scale = new Vector2(objectState.Scale);
|
||||
Rotation = objectState.Rotation;
|
||||
Scale = Vector2.Divide(objectState.DisplaySize, Size);
|
||||
Rotation = objectState.DisplayRotation;
|
||||
AccentColour.Value = objectState.AccentColour.Value;
|
||||
HyperDash.Value = objectState.HyperDash.Value;
|
||||
}
|
||||
|
@ -29,16 +29,14 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
/// </summary>
|
||||
protected virtual float ScaleFactor => 1;
|
||||
|
||||
public float DisplayRadius => CatchHitObject.OBJECT_RADIUS * HitObject.Scale * ScaleFactor;
|
||||
|
||||
/// <summary>
|
||||
/// The container internal transforms (such as scaling based on the circle size) are applied to.
|
||||
/// </summary>
|
||||
protected readonly Container ScalingContainer;
|
||||
|
||||
float IHasCatchObjectState.Scale => HitObject.Scale * ScaleFactor;
|
||||
public Vector2 DisplaySize => ScalingContainer.Size * ScalingContainer.Scale;
|
||||
|
||||
float IHasCatchObjectState.Rotation => ScalingContainer.Rotation;
|
||||
public float DisplayRotation => ScalingContainer.Rotation;
|
||||
|
||||
protected DrawablePalpableCatchHitObject([CanBeNull] CatchHitObject h)
|
||||
: base(h)
|
||||
@ -65,7 +63,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
ScaleBindable.BindValueChanged(scale =>
|
||||
{
|
||||
ScalingContainer.Scale = new Vector2(scale.NewValue * ScaleFactor);
|
||||
Size = ScalingContainer.Size * ScalingContainer.Scale;
|
||||
Size = DisplaySize;
|
||||
}, true);
|
||||
|
||||
IndexInBeatmap.BindValueChanged(_ => UpdateComboColour());
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Bindables;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
@ -15,7 +16,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
||||
Bindable<Color4> AccentColour { get; }
|
||||
Bindable<bool> HyperDash { get; }
|
||||
|
||||
float Rotation { get; }
|
||||
float Scale { get; }
|
||||
Vector2 DisplaySize { get; }
|
||||
float DisplayRotation { get; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user