Files
raea/docs/manual/reference/cli/playable.md
T
shaneandshinyobjectz 5301beb62f Playables: a 2D page carries no three.js, fonts as the native render draws them, a playable goal, exact light rows (#311)
PA15: the host asks for its 3D through one interface (host/draw3d.ts). The export passes three.js's drawer to
start() only when the lint finds a 3D kind, so a 2D game's page drops from about 1,345 KB to 378 KB.

PA8: the page inlines core/fonts' faces under every family the game names that raea aliases, each weight drawn
by the face core/fonts picks. Inter is the page's default.

PA19: core/brief has a playable goal (game, name, networks, orientation, seconds, video). Its deliverables are what
`raea playable` writes, and raea goal's playable pack reads the export's new manifest. `raea playable --name`.
The generated declarations are split in two files to stay under 500 lines each.

PA18: the fast rows rounded a light's rotation to 6 decimals while the full rows wrote it exact, so
RAEA_LIVE3D_CHECK panicked on brick-rush. Rotation and colour columns now pass through exact, and the corpus
no longer skips brick-rush.

tools/check.ts plays with TAP_MS (0 is an instant tap). apps/make's step tests compile again.

Co-authored-by: shinyobjectz <[email protected]>
2026-12-03 10:55:16 -08:00

3.1 KiB

title, summary, order, sources
title summary order sources
raea playable Export a game as a playable ad: one page or ZIP for each ad network, under its size cap, from the same TSX that renders as the video ad. 5
apps/playable/src/lib.rs

raea playable turns a raea game into a playable ad: a short game served in place of a video ad inside other apps, ending on a card that opens the store. The same file renders with raea render as the video ad, because a game that nobody touches plays itself. Each network gets the page or ZIP it takes, with its own start, pause and store calls, checked against its 5 MB cap. Nothing in the page loads anything: pictures, sounds and the 3D renderer travel inside it.

raea playable game.tsx -o out/playable --ios https://apps.apple.com/app/id123 --android https://play.google.com/store/apps/details?id=com.example
raea playable game.tsx -o out/playable --networks applovin,google,preview --cta "Play free"

Before it bundles, the export refuses what a playable can't have: files read from disk at render time (staticFile; import the file instead), URLs and network calls, modules that need the native engine, <Video> and <Audio>, and 3D kinds the playable's renderer doesn't draw. It notes a game with only one orientation, and one that never imports raea/playable (<EndCard>, <InstallButton>, install()) to open the store itself.

The 3D is drawn by three.js on raea's scene contract, with Bevy's light units and tone mapping. It comes from the project (raea add [email protected]).

Usage

raea playable GAME.tsx -o DIR [--name NAME] [--networks LIST] [--ios URL] [--android URL] [--title TEXT] [--cta TEXT] [--orientation portrait|landscape|both]   (a game as a playable ad: one page or ZIP per network (applovin, unity, google, meta, moloco, mintegral, tiktok, liftoff, preview), each under its 5 MB cap, from the TSX that renders as the video ad)

Headless: it needs nothing running and opens no window. Takes up to 1 argument besides its flags.

Flags

Flag Takes What it does
--android URL The Google Play page the store tap opens on Android.
--cta TEXT The button's words on the host's own end card, Play now by default. A game's <EndCard cta> sets its own.
--ios URL The App Store page the store tap opens on iPhone and iPad.
--networks LIST The networks to write, split by commas: applovin, unity, google, meta, moloco, mintegral, tiktok, liftoff, preview. All of them by default.
--orientation portrait|landscape|both What Google's ad.orientation tag and TikTok's config.json are told; both by default. The game plays whichever of its compositions is nearest the screen's shape either way.
--title TEXT The title on the host's own end card, shown at the last frame when the game never shows an <EndCard>.
-o DIR The folder the pages and ZIPs go in, named GAME-NETWORK.html or .zip.