mirror of
https://github.com/osukey/osukey.git
synced 2025-06-06 20:15:29 +09:00
Align osu!catch playfield with stable 1:1
This commit is contained in:
parent
1f14d9b690
commit
a94a86178b
@ -17,8 +17,12 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
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(playfield_size_adjust);
|
Size = new Vector2(playfield_size_adjust);
|
||||||
|
|
||||||
@ -29,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, }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user