The ScrapyardIO Node-based UX library (layered Scene / Node / Drawable / UIComponent).
Package info
pkg:composer/scrapyard-io/ux
0.7.2
2026-08-12 03:11 UTC
Requires
- php: ^8.4|^8.5|^8.6
- fabricate/console: ^0.7.0
- fabricate/contracts: ^0.7.0
- fabricate/nuts-and-bolts: ^0.7.0
- fabricate/sketches: ^0.7.0
- tubes/canvas: ^0.7.0
- tubes/contracts: ^0.7.0
- tubes/human-input: ^0.7.0
- tubes/inputs: ^0.7.0
- tubes/panels: ^0.7.0
- tubes/rendering: ^0.7.0
- tubes/windows: ^0.7.0
Requires (Dev)
- pestphp/pest: ^4
Suggests
- scrapyard-io/tubes: Kitchen-sink metapackage that replaces tubes/* and ships Tubes\Core (MagicAliases, CanvasProfiles, WindowLoop nodes) used by UX demo sketches (^0.7)
README
UX is the ScrapyardIO layered scene / node library for 0.7. A screen is a
tree of Node / Drawable / UIComponent children orchestrated by a Scene
that paints through a borrowed tubes Renderer2D into a Canvas framebuffer.
game-engine (future) → scrapyard-io/ux → scrapyard-io/tubes → framework
Requirements
- PHP 8.4+
scrapyard-io/framework^0.7scrapyard-io/tubes^0.7
Installation
composer require scrapyard-io/ux:^0.7.0 php workshop package:discover
Publish the config to change the palette or default metrics:
php workshop vendor:publish --tag=ux-config
Quick start
use ScrapyardIO\UX\Components\Chrome\Panel; use ScrapyardIO\UX\Components\Chrome\StatusBar; use ScrapyardIO\UX\Components\Ball; use ScrapyardIO\UX\Core\Scene; $root = Panel::surface(); $root->addChild(StatusBar::of('L', 'C', 'R')); $root->addChild(Ball::of(24)->setCenter(160, 120)); $scene = (new Scene)->attach($window)->setRoot($root); $renderer->setFramebuffer($window->framebuffer()); $scene->paint($renderer); $renderer->unsetFramebuffer(); $window->present();
Demo
With UX installed, the tubes smoke name runs the UX Scene sketch:
./runner canvas-window-demo
./runner canvas-window-demo sdl3 --fps=60
./runner ux-canvas-window-demo # explicit alias
Generators
php workshop make:component Hud/Meter php workshop make:ux-node Entities/Player
Docs
Ecosystem docs and the package .okf/ knowledge bundle cover the layered tree,
ownership vs tubes, and the engine extension seam.