0.0.6 • Published 7 years ago

layaair-extra v0.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Use WebGL create cross-platform UI

lib is fork laya-air: http://ldc.layabox.com/

安装

$ yarn add layaair-extra

编写简单的项目

$ cp -rf node_modules/layaair-extra/public public   #拷贝通用public
$ touch src/index.ts

src/index.ts 编写以下代码:

import { air, Laya, plus } from 'layaair-extra';

// 如果要用Laya开发游戏、使用Laya的Debug工具
import 'layaair-extra/src/LayaGame';
import 'layaair-extra/src/LayaDebugTool';

class App extends Laya.Sprite {
  constructor() {
    super();
    // do someting
    const label = new Laya.Text();
    label.text = 'Hello LayaAir Extra';
    label.fontSize = 40;
    this.addChild(label);
  }
}

air.initGame({
  RootComponent: App,
  type: 'vertical',
  statPosition: [30, 30],
  compeleted: startGame,
});
function startGame() {
  // do someting
}

启动项目

$ npm install -g pillar-pack
$ pillar-pack

浏览器预览 http://127.0.0.1:3100/index.dev.html

licensed

layaair-extra is MIT licensed.

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago