@rutan/akashic-flexbox
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@rutan/akashic-flexbox

use yoga-layout in Akashic Engine

install

npm install @rutan/akashic-flexbox

Usage

import {View} from '@rutan/akashic-flexbox';

export function main() {
  const scene = new g.Scene({ game: g.game });
  scene.loaded.add(() => {
    const root = View.create()
      .width(g.game.width)
      .height(g.game.height)
      .direction('row')
      .justifyContent('center')
      .alignItems('center');

    root.child(
      View.create({
          entityClass: g.FilledRect,
          entityParameterObject: { cssColor: '#f00' }
       })
         .width(100)
         .height(50)
    );

    root.child(
      View.create({
          entityClass: g.FilledRect,
          entityParameterObject: { cssColor: '#0f0' }
       })
         .width(200)
         .height(100)
         .marginLeft(50)
    );

    scene.append(root.build(scene));
  });
  g.game.pushScene(scene);
}

demo

please see demo/

Readme

Keywords

none

Package Sidebar

Install

npm i @rutan/akashic-flexbox

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

62.9 kB

Total Files

37

Last publish

Collaborators

  • rutan