Align osu!catch playfield with stable 1:1

This commit is contained in:
Dean Herbert 2020-08-20 19:12:37 +09:00
parent 1f14d9b690
commit a94a86178b
1 changed files with 14 additions and 4 deletions

View File

@ -17,8 +17,12 @@ public class CatchPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
public CatchPlayfieldAdjustmentContainer()
{
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
// because we are using centre anchor/origin, we will need to limit visibility in the future
// 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(playfield_size_adjust);
@ -29,7 +33,7 @@ public CatchPlayfieldAdjustmentContainer()
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
FillAspectRatio = 4f / 3,
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both }
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both, }
};
}
@ -42,8 +46,14 @@ protected override void 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);
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);
}
}
}