mirror of
https://github.com/ppy/osu.git
synced 2024-09-21 18:47:27 +08:00
Merge pull request #27162 from frenzibyte/catch-playfield
Limit vertical visibility of osu!catch playfield to an aspect ratio of 4:3
This commit is contained in:
commit
207ad599d0
@ -21,7 +21,6 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
public void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> drawableRuleset)
|
public void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> drawableRuleset)
|
||||||
{
|
{
|
||||||
drawableRuleset.PlayfieldAdjustmentContainer.Scale = new Vector2(1, -1);
|
drawableRuleset.PlayfieldAdjustmentContainer.Scale = new Vector2(1, -1);
|
||||||
drawableRuleset.PlayfieldAdjustmentContainer.Y = 1 - drawableRuleset.PlayfieldAdjustmentContainer.Y;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,24 +17,36 @@ namespace osu.Game.Rulesets.Catch.UI
|
|||||||
|
|
||||||
public CatchPlayfieldAdjustmentContainer()
|
public CatchPlayfieldAdjustmentContainer()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre;
|
const float base_game_width = 1024f;
|
||||||
Origin = Anchor.TopCentre;
|
const float base_game_height = 768f;
|
||||||
|
|
||||||
// playfields in stable are positioned vertically at three fourths the difference between the playfield height and the window height in stable.
|
// extra bottom space for the catcher to not get cut off at tall resolutions lower than 4:3 (e.g. 5:4). number chosen based on testing with maximum catcher scale (i.e. CS 0).
|
||||||
// we can match that in lazer by using relative coordinates for Y and considering window height to be 1, and playfield height to be 0.8.
|
const float extra_bottom_space = 200f;
|
||||||
RelativePositionAxes = Axes.Y;
|
|
||||||
Y = (1 - playfield_size_adjust) / 4 * 3;
|
|
||||||
|
|
||||||
Size = new Vector2(playfield_size_adjust);
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
InternalChild = new Container
|
InternalChild = new Container
|
||||||
{
|
{
|
||||||
|
// This container limits vertical visibility of the playfield to ensure fairness between wide and tall resolutions (i.e. tall resolutions should not see more fruits).
|
||||||
|
// Note that the container still extends across the screen horizontally, so that hit explosions at the sides of the playfield do not get cut off.
|
||||||
|
Name = "Visible area",
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.X,
|
||||||
FillMode = FillMode.Fit,
|
Height = base_game_height + extra_bottom_space,
|
||||||
FillAspectRatio = 4f / 3,
|
Y = extra_bottom_space / 2,
|
||||||
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both, }
|
Masking = true,
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
Name = "Playable area",
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
// playfields in stable are positioned vertically at three fourths the difference between the playfield height and the window height in stable.
|
||||||
|
Y = base_game_height * ((1 - playfield_size_adjust) / 4 * 3),
|
||||||
|
Size = new Vector2(base_game_width, base_game_height) * playfield_size_adjust,
|
||||||
|
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both }
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user