code wiki / (root) / nx_scene_demo.nx

nx_scene_demo.nx

buildroot/runtime/nx_scene_demo.nx

5297 B106 linesdepth 5pulls 7 transitivereach 1 importersview sourcekind sketch/demotopic scene
docsdependenciesstructsconstsfunctions

about

nx_scene_demo.nx -- SOVEREIGN VISUAL ENGINE: sprites + Image->browser-canvas. Reuses nx_image (RGB container) for the framebuffer; adds color drawing (px/fill_rect), pixel-art SPRITE blit (palette index grid, 0=transparent), a small game scene, and the missing bridge: emit a rendered Image as a scaled, pixel-perfect HTML canvas (base64 RGB -> ImageData). No external images, no library -- pixels authored in .nx. license_tier: ORIGINAL.

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_image.nx nx_base64.nx nx_scene_demo.nx nx_scene_demo_test.nx

imports: nx_syscalls.nxnx_image.nxnx_base64.nx

imported by: nx_scene_demo_test.nx

structs

none

consts

12const K_MAGIC_262144: i64 = 262144

functions

14func sc_px(img: *Image, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64
called by 2: sc_fillsc_blit8 calls 1: nx_image_set
20func sc_fill(img: *Image, x0: i64, y0: i64, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64
called by 1: nx_scene_build calls 1: sc_px
26func sc_blit8(img: *Image, dx: i64, dy: i64, grid: *u8, r: i64, g: i64, b: i64) -> i64
called by 1: nx_scene_build calls 1: sc_px
37func sc_app(out: *u8, off: *i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[off[0]] = s[i]; off[0] = off[0] + 1; i = i + 1 } return 0 }
called by 1: nx_img_canvas_page
38func sc_app_n(out: *u8, off: *i64, v: i64) -> i64
called by 1: nx_img_canvas_page calls 1: sys_mmap
47func nx_scene_build() -> *Image
73func nx_img_canvas_page(img: *Image, scale: i64, out: *u8, cap: i64) -> i64
96func nx_scene_save(path: *u8, scale: i64) -> i64