Skip to content

iOS shell: Picture row, Fit or Fill for screens that are not 16:9 - #575

Merged
v0lumehi merged 1 commit into
mainfrom
v0lumehi/picture-fill
Nov 3, 2026
Merged

v0lumehi merged 1 commit into
mainfrom
v0lumehi/picture-fill

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Fix or feature

  • Fix
  • Feature

Feature from outside: not from outside. The issue is #545 in milestone v1.1.0.

What and why

Closes #545.

Most iPhones are wider than 16:9 and an iPad is 4:3. The game is always the largest 16:9 rectangle with black bars. @digitalkid56 asked for a picture that fills the screen.

Each game's settings now have a Picture row in the Game section: Fit or Fill.

  • Fit is the default and today's picture.
  • Fill scales the 16:9 picture up until it covers the whole screen and crops what lies outside. Nothing is stretched.
  • The row's note says what Fill costs: the game still renders 16:9, so health bars, subtitles or maps near the edges can be cut off. A full-screen picture without cropping needs a game patch per game that renders a wider view. That is follow-up work.

How it works:

  • Engine patch 0063 adds DM_PICTURE_FIT (fit or fill) to dm/games/settings.tsv as a platform:ios choice, so it reaches every iOS game's launcher.json. The shell shows it like the other per-game rows, keeps it in the game's own suite and passes it with the other DM_* values at launch. The shell needed no code for that, only the texts.
  • front_ios.m reads DM_PICTURE_FIT at game start. DmLayout.h has the pure functions: dm_aspect_fill (the smallest centered 16:9 rectangle that covers the view), dm_layout_picture and dm_game_touch_point.
  • The touch controls and the virtual gamepad stay laid out on the full view. The game's own touch screen is normalized on the scaled picture (pushGame uses dm_game_touch_point), so a touch on the visible part lands where that part of the picture is.
  • My decision for the Duo layouts of iOS: add Duo portrait and tabletop gameplay layouts #230: Fill applies to the landscape full-screen layout only. In the portrait and tabletop splits the picture stays fitted in its area above the controls, because cropping a small picture costs more than the bars. A TV keeps Fit too.

One view fix comes with it. A segmented choice used ViewThatFits over the label and the segments together. A long note made the label too wide, so a two-option row fell back to the compact list row. Upscaling in German already did that on main (see the before image). Now only the segments decide, and the label wraps to the card.

Texts: launch.set.DM_PICTURE_FIT, its .note and launch.opt.DM_PICTURE_FIT.fit / .fill in all six files, as DM_SHOW_FPS does (the Mac's LaunchOptionsTests wants a launch.* entry for every row of settings.tsv). English and Chinese are mine. German, French, Swedish and Italian are machine-translated, please check them. tools/l10n_shell_catalogs.py --check passes and tools/tests/launcher_texts.txt is regenerated.

Upstream: the same change is seedds/nxnative#1083. It builds on seedds/nxnative#683 (the Duo layouts, our 0061), so it is stacked on that branch. The fork's patch also adds a missing front_ios_device_check stub to the Duo harness, so the harness links again at our pin. Upstream's branch of #683 does not need it.

Checked

  • Tests: swift test --package-path frontend-ios (new PictureFitTests: the row, its default, the per-game suite, DM_PICTURE_FIT=fill in the launch environment and the plan. New PictureFitRowTests: the texts in every shell language and the segmented choice). python3 -m unittest discover tools/tests. python3 tools/engine.py check. In engine/: dm/tools/tests/test_launcher_settings.py and test_player_env.py. The pre-push hook ran the Mac launcher tests. test_env_switches.py fails on main too (DM_FONT_CACHE and others), the new row adds nothing to it.
  • Duo harness (engine/dm/ios/tests/duo) in the iOS 27 Simulator: 28 tests pass and 1 is skipped (the virtual controller case), among them three new ones for the cover rectangle on iPhone, iPad and 16:9 sizes, the portrait and tabletop splits that stay fitted, and touches on the cropped picture.
  • Visual QA: PictureFitCaptureTests with NX_SHELL_CAPTURE_DIR, in English, German and Chinese.
  • Run on a device: not done. Not verified: no real iPhone or iPad, no Duo, and the picture on a real display. Games that draw their UI near the edges lose part of it with Fill. That is expected and the note says so.

Screenshots

The Game section of a game's settings.

Before, English:

before-en

After, English, Fit and Fill:

after-fit-en
after-fill-en

Before, German (Upscaling already fell back to the list row):

before-de

After, German, Fill:

after-fill-de

After, Chinese, Fit:

after-fit-zh

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#1083
  • A change to a launcher view has before and after screenshots above
  • No keys, game files or data extracted from a game in the change or the attachments

Patch 0063 adds DM_PICTURE_FIT to the engine's settings list (platform:ios)
and lets the iOS front end scale the 16:9 picture to cover the screen in
landscape. The shell shows it as a per-game segmented choice in the Game
section with a note on what Fill crops. Texts in all six languages.

A segmented row now wraps its label to the card, so a long note no longer
pushes a two-option choice into the compact list row.
@v0lumehi v0lumehi added this to the v1.1.0 milestone Nov 3, 2026
@v0lumehi v0lumehi added enhancement New feature or request launcher The NX2Apple launcher app ios iPhone or iPad labels Nov 3, 2026
@github-actions github-actions Bot added windows Windows (the Qt front end) patch-queue Changes the patch queue or the upstream pin labels Nov 3, 2026
@v0lumehi v0lumehi mentioned this pull request Nov 3, 2026
1 task done
@v0lumehi
v0lumehi merged commit c1cf03b into main Nov 3, 2026
18 checks passed
victorwads pushed a commit to victorwads/NX2Apple that referenced this pull request Nov 3, 2026
LNPANDY#575 took 0063 and LNPANDY#579 reserves 0064. The geometry test also checks that
the picture Fill (0063) leaves the controls where they are.
@v0lumehi
v0lumehi deleted the v0lumehi/picture-fill branch November 20, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ios iPhone or iPad launcher The NX2Apple launcher app patch-queue Changes the patch queue or the upstream pin windows Windows (the Qt front end)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fullscreen Toggle/Support for iPhone Duo

1 participant