Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Other skills

duo-games

Builds games for iPhone Duo, Apple's foldable. The game fills the closed outer display, the open inner display, book pose and tabletop by changing its aspect ratio instead of letterboxing, as Apple's HIG asks; touch controls stay off the fold; and in tabletop the world sits above the fold with the controls below it, like a handheld console. Use when you build or port a SpriteKit, Metal or SwiftUI game, when a game letterboxes, restarts or loses input on fold or unfold, or when you add touch controls or game controller support. Covers SKScene .resizeFill with a camera that keeps the play area in view, one scene or renderer that survives every fold (measured), MTKView drawableSizeWillChange, a UIWindowScene display link that follows the scene to the other display, TouchZones split at the .division reserved region, GameLayout for tabletop, GCController and the simulator's own Gamepad, GCVirtualController and Touch Controller placement, orientation locks the inner display ignores, and two-

Kimeur · Static checks on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add Kimeur/duology --skill duo-games

About this skill


name: duo-games description: "Builds games for iPhone Duo, Apple's foldable. The game fills the closed outer display, the open inner display, book pose and tabletop by changing its aspect ratio instead of letterboxing, as Apple's HIG asks; touch controls stay off the fold; and in tabletop the world sits above the fold with the controls below it, like a handheld console. Use when you build or port a SpriteKit, Metal or SwiftUI game, when a game letterboxes, restarts or loses input on fold or unfold, or when you add touch controls or game controller support. Covers SKScene .resizeFill with a camera that keeps the play area in view, one scene or renderer that survives every fold (measured), MTKView drawableSizeWillChange, a UIWindowScene display link that follows the scene to the other display, TouchZones split at the .division reserved region, GameLayout for tabletop, GCController and the simulator's own Gamepad, GCVirtualController and Touch Controller placement, orientation locks the inner display ignores, and two-player games." metadata: verified: "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no" sources: "https://github.com/Kimeur/duology/blob/main/reference/sources.md"

duo-games

A game on iPhone Duo resizes every time someone opens, closes, rotates or folds the phone, often in the middle of play. This skill keeps the game running through all of it, fills every pose, keeps thumbs off the fold, and turns the bottom half into a controller when the phone sits on a table.

Load neighbours when the task needs them: duo-shared-screen and recipe-two-player-game (two people on one phone), duo-postures (every pose, and hinge effects), duo-layout (reserved regions in depth), duo-continuity (state through a fold), duo-ergonomics (thumb reach).

"Book" and "tabletop" are Duology's words for Apple's "partially folded, like a book" and "seated on a table like a laptop". No API reports them. Labels: measured means we ran it in a probe app on the iPhone Duo simulator (Xcode 27.1, iOS 27.1, 20 Oct 2026); logs in references/measurements.md. Unverified means we could not confirm it. Everything else links to Apple.

Rules

  1. Fill the screen in every pose. Change the aspect ratio: show more or less of the world. Letterbox only when you can't avoid it, and then put artwork in the bars (HIG: iPhone Duo).
  2. Keep text and controls the same size in every pose. Size them in points, outside the world, not in world units that a camera scales (HIG: iPhone Duo).
  3. One game per window, owned above every layout switch. A fold resizes the scene or the drawable. It never makes a new scene, renderer or game state.
  4. Resize, don't restart. Size callbacks only recompute what depends on size: the camera, the projection, size-matched textures.
  5. Nothing touchable in the fold. Movement on the leading side, actions on the trailing side, and the whole .division frame, margins included, belongs to neither, flat or folded (talk 111466).
  6. Tabletop: the world in the top region, the controls in the bottom region, and the same controls as every other pose. Apple suggests this split for media on a table; it fits games too (talk 111466).
  7. Handle tall and wide in every build. You may lock the orientation, but the inner display ignores the lock (talk 111461).
  8. Touch always works. A game controller is an extra. Hide touch controls only after the player uses a controller (HIG: Game controls).
  9. Pause on the scene phase, never on a fold. Folding is part of play. Set the scene's own isPaused: SpriteView(isPaused:) didn't resume the game (measured).
  10. No hinge as a game input unless the player turns it on and an on-screen control does the same job (duo-postures).

What the game gets in each pose

Measured with the code below: the world ignores the safe area, the controls stay inside it.

PoseWindowScene (world)Touch controls.division seen by the controls
Closed466 × 678 pt466 × 678 pt382 × 644 pt (84 pt trailing and 34 pt bottom inset)none
Open, flat, held wide951 × 669 pt951 × 669 pt951 × 635 ptinactive, 40 × 669 pt at x = 455.5
Book951 × 669 pt951 × 669 pt951 × 635 ptactive, same frame
Tabletop669 × 951 pt669 × 455.7 pt, above the fold669 × 421.5 pt, below the foldnone: the fold lies outside the controls
  • The fold's frame runs from x = 455.5 to 495.5. That is centred in a full-width 951 pt game, but not in a view that a vertical bar narrows: in an 867 pt view the middle is 22 pt left of the fold (measured in duo-reading). Split at the fold frame, never at width / 2.
  • Open, held tall, and Split View were not measured with this game. Plan for any size.

1. Fill the screen: resize the scene, move the camera

.resizeFill makes the scene exactly the size of its view (resizeFill). A camera then scales so the play area always fits; spare room shows more world. Every pose we measured is less wide than the 16:10 play area below, so it fills the width and the spare room shows above and below it: a lot on the closed phone held upright, little in book and tabletop (derived from the measured sizes).

import SpriteKit

/// What the touch controls and a game controller write, and the scene reads 
Read the complete source ↗