Keep presentation alive across levels and scale UI for widescreen
This commit is contained in:
1 parent
113e9a41cc
commit
69d0187a21
26 files changed
+889
-70
No files matched your search
@@ -26,6 +26,28 @@ Check(final.Draws.Skip(1).Count(d => d.Visible) == 3, "Live panel has no selecte
|
||||
overlay.Update(final, ["Menu", "Resume", "Camera"], 1);
|
||||
Check(final.Vertices[2].Position.X == menuRight && final.Vertices[3].Position.Y == menuBottom,
|
||||
"Returning to menu restores its full layout using the same buffers");
|
||||
foreach (var (width, height) in new[] { (1920u, 1080u), (3440u, 1440u), (3840u, 1080u), (1080u, 1920u) })
|
||||
{
|
||||
Vector2 Pixel(int index)
|
||||
{
|
||||
var p = final.Vertices[index].Position;
|
||||
return new((p.X + 1) * width / 2, (p.Y + 1) * height / 2);
|
||||
}
|
||||
var viewport = new UiViewport(width, height);
|
||||
overlay.Update(final, ["Menu", "Resume", "Camera"], 1, viewportWidth: width, viewportHeight: height);
|
||||
var backgroundLeft = Pixel(1).X; var backgroundRight = Pixel(2).X;
|
||||
Check(MathF.Abs((backgroundLeft + backgroundRight) / 2 - width / 2f) < .003f,
|
||||
"F1 panel centers in the wide physical viewport");
|
||||
var character = Pixel(9);
|
||||
Check(MathF.Abs((Pixel(10).X - character.X) / 7 - (Pixel(12).Y - character.Y) / 9.8f) < .0001f,
|
||||
"F1 glyphs retain equal X/Y scale");
|
||||
overlay.Update(final, ["F2 LIVE DEBUG", "ROOT X 10 Y 20 Z 30"], compact: true, viewportWidth: width, viewportHeight: height);
|
||||
Check(Vector2.Distance(Pixel(1), new Vector2(8 * viewport.Scale)) < .003f,
|
||||
"F2 remains at the uniform top-left safe inset");
|
||||
character = Pixel(9);
|
||||
Check(MathF.Abs((Pixel(10).X - character.X) / 5.6f - (Pixel(12).Y - character.Y) / 7.84f) < .0001f,
|
||||
"F2 glyphs are never stretched across widescreen");
|
||||
}
|
||||
overlay.Update(final, [new string('X', 100)], -1);
|
||||
Check(final.Draws.Skip(1).Count(d => d.Visible) == 2, "Long labels clip to bounded text range");
|
||||
overlay.Update(final, []);
|
||||
|
||||
Reference in new issue
Block a user