Repository navigation
H12: <Screen app> draws its app on a Blitz document of its own - #161
Open
shinyobjectz wants to merge 6 commits into
Open
shinyobjectz wants to merge 6 commits into
shinyobjectz wants to merge 6 commits into
Conversation
raea-runtime-jsengine at_clock(ms, f) runs f with this thread's JS clock (the timers' now and performance.now) held at ms, so a root stepped on a composition's frames sees the same time in a render and its play. raea-runtime-bundle-lib app::bundle_screen bundles a module as an app is, its default export given {width: innerWidth, height: innerHeight}: an app screen's, one bundle for a screen of any size. bundle_surface (real react-dom/client into #root, the old Blitz surface's entry) is gone; nothing calls it.
raea-runtime-appscreen opens each app screen's module on a BlitzPage of its own at the screen's size, on the shared device, with the CSS its modules import and Tailwind's for its folder (or an exported game's prebuilt X.tsx.surface.js and .surface.css). It is stepped once a frame: the input route() gave it as Blitz's pointer, wheel and key events, then one update that runs its JS on the frame's clock, and paints; the draw's later updates while faces load only paint. runtime/page's sync steps every app screen (screen.rs step_all, at at_frame's frame in a render and set_app_frame's in live play) instead of saying it isn't drawn, and its picture goes with the nested screens' (screen_textures, frame_all) to Engine::copy_screen or set_screen_picture.
…n; exported games bundle app screens as apps Live play routes the pointer, wheel and keys to an app screen through the 3D (screen.rs route); its input log now keeps what reached the app screens each frame under `apps` (BevyPage::app_input) and leaves the keys they took out of the page's, and raea render --input gives the app screens the same (screen.rs APP_LOG), so the render draws what was played. Live play sets the app screens' frame each step. export-game writes each app screen's X.tsx.surface.js and .surface.css with the new bundle, and its check for the old surface runtime (a marker no player has had since Blitz left) is gone: every player draws app screens on its own Blitz page.
…ve P27c points at it); the appscreen bench (sdk/raea/bench/bevy/appscreen: a button clicked through the 3D, its own timer on the frame's clock; check.sh 9 PASS) and its bench/render-play row (1.000000 at frames 6, 12, 18 and 27; the bench 14 of 14); the apps guide, <Screen app>'s doc and the manual's reference; skills pin: raea-skills #89 (80067cc), motion/apps.md the same guide
… in raea-runtime-appscreen, and an app screen's texture handed over as bevy's; live play's needs_react in its own file (raea-runtime-page under 2000 lines, runtime/live/src/lib.rs under 500, no new duplicate groups)
…WINDOW, SCREEN) in place of two one-line forwarders; the app screens' log read through screen::logged (no new duplicate groups: 292 exact, 59 near)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<Screen app="kit.tsx">now draws its app. Until this PR, raea refused it ("isn't drawn yet: app screens move to raea-runtime-js roots of their own (ts-native P27)"), so a composition that put a React UI on a 3D screen got a blank panel. This change runs the module's component on @raea/ui's react-dom in a Blitz document of its own and copies its picture onto the screen the way a nested composition's picture is copied.What changed
runtime/appscreen(raea-runtime-appscreen). AnAppScreenopens the module (its prebuilt bundle if there is one, otherwise it bundles it with its CSS and its folder's Tailwind). It mounts the component with{ width, height }on a Blitz page and steps it once per frame. It turns the routed pointer, keys and wheel into window events.Routedholds what reached the app screens in a frame and round-trips it through the input log.app::bundletakes the props its default export is mounted with (app::WINDOWfor an app in its own window,app::SCREENfor an app screen's{ width, height }). The callers in apps/targets and the rune host's tests passWINDOW, which is what they got before.runtime/jsengine):at_clock(ms, f)makesperformance.nowand timers read the frame's time during a step. A render therefore repeats frame for frame.screen.rsopens, steps and retires app screens (step_all,retire) and hands their textures and pictures to the 3D. The refusal line is gone.appsin the input log).raea render --inputgives the same input back throughAPP_LOG, so the render draws what was played. While an app screen has the keys, the game doesn't get them (runtime/live).export-gamewritesX.tsx.surface.jsand.surface.cssbeside each app module, so the player no longer needs a separate feature for app screens.<Screen app>'s doc, the manual's 3D reference and themotion/apps.mdguide are updated, including a new "Not yet" list.Measured
sdk/raea/bench/bevy/appscreen: a button in an app on a flat screen, clicked through the 3D, with a timer bar.check.shpasses 9 of 9 on exact colours. The checks: drawn, hover ring, pressed-not-released, clicked from the release on, ring gone after the pointer leaves, a timer bar on the frame clock, andappsentries kept in the log.bench/render-play/appscreenrow scores 1.000000 SSIM between play and render at frames 6, 12, 18 and 27. The whole render-play bench passes 14 of 14.appsentries stripped shows the button unclicked (SSIM 0.9909 against the play). The click really travels through the log.tools/agents/check --land --lane appscreen) passes every step, dupes at 292 exact and 59 near.Merge with raea-skills #89
The skills submodule is pinned to shinyobjectz/raea-skills#89 (
80067cc), which carries the samemotion/apps.mdguide. Merge #89 together with this PR, then repinskillsto #89's merge commit.Not tested
export-gamepath end to end: the bundles are written, but an exported player drawing an app screen hasn't been run.Not yet (in the guide)
Datein an app screen reads the wall clock, so a render shows another time than its play. Timers andperformance.nowfollow the frame.🤖 Generated with Claude Code