Half an hour to get started laya

laya performance pricey, with top pixi.js worse. Better than the performance of some of the egret

laya code is functional bias, ornamental, readability than the poor.

Under the first step, github watched, layaair less than two hundred stars?

Think layaair dignified, she could be so pathetic, but looking to find good work.

The second step to see the entrance file Laya.ts

  • Look, this setback code, perhaps to use to facilitate it. The setback did not write the code that is also compatible as?
  • Pixi.js still have feelings, reading pixijs code, you are js master. Layaair code reading, huh
  • laya core functions can be performed by Laya. Function Method.

The third step is to see the display logic 

  • stage -> sprite -> node -> eventdispatcher
  • cmd with too much, feeling a bit top-heavy
  • node base class for all display objects
  • sprite base class for all containers, packaging textile processing, graphics can be painted. wonder thousands of lines of a sprite class. This is different from other engines.
  • Then looked thin codes, node can addChild (node). All the Object Description laya can add objects, which other engines are very different

The fourth step look at resource management (loading and caching)

  By Laya.net under the Loader and LoadManager managed. The traditional way to achieve, is divided into load pictures, sounds, and ajax to load.

  To cache resources through Loadre.cacheRes

The fifth step identification is completed (No wonder only a hundred stars) basically hand

Guess you like

Origin www.cnblogs.com/honghong87/p/11892085.html