PHP code example of scrapyard-io / ux

1. Go to this page and download the library: Download scrapyard-io/ux library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

scrapyard-io / ux example snippets


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();
bash
php workshop vendor:publish --tag=ux-config