mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge pull request #9926 from peppy/catch-playfield-width-adjust
Fix osu!catch playfield bounds not matching expectations
This commit is contained in:
@ -10,15 +10,21 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
|
||||||
{
|
{
|
||||||
|
private const float playfield_size_adjust = 0.8f;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
public CatchPlayfieldAdjustmentContainer()
|
public CatchPlayfieldAdjustmentContainer()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre;
|
// because we are using centre anchor/origin, we will need to limit visibility in the future
|
||||||
Origin = Anchor.TopCentre;
|
// to ensure tall windows do not get a readability advantage.
|
||||||
|
// it may be possible to bake the catch-specific offsets (-100..340 mentioned below) into new values
|
||||||
|
// which are compatible with TopCentre alignment.
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Size = new Vector2(0.86f); // matches stable's vertical offset for catcher plate
|
Size = new Vector2(playfield_size_adjust);
|
||||||
|
|
||||||
InternalChild = new Container
|
InternalChild = new Container
|
||||||
{
|
{
|
||||||
@ -27,7 +33,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
FillAspectRatio = 4f / 3,
|
FillAspectRatio = 4f / 3,
|
||||||
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both }
|
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both, }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,8 +46,14 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
// in stable, fruit fall vertically from -100 to 340.
|
||||||
|
// to emulate this, we want to make our playfield 440 gameplay pixels high.
|
||||||
|
// we then offset it -100 vertically in the position set below.
|
||||||
|
const float stable_v_offset_ratio = 440 / 384f;
|
||||||
|
|
||||||
Scale = new Vector2(Parent.ChildSize.X / CatchPlayfield.WIDTH);
|
Scale = new Vector2(Parent.ChildSize.X / CatchPlayfield.WIDTH);
|
||||||
Size = Vector2.Divide(Vector2.One, Scale);
|
Position = new Vector2(0, -100 * stable_v_offset_ratio + Scale.X);
|
||||||
|
Size = Vector2.Divide(new Vector2(1, stable_v_offset_ratio), Scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user