LayaAir开发

起言:在经过layaair技术开发游戏以前最好对TS和es6有必定的了解。es6

1、LayaBox引擎开发各组件做用数组

文档地址:http://ldc.layabox.com/函数

2、开发过程遇到的问题ui

  1.tab切换(经常使用在排行,功能切换等方面)this

  this.topTab.selectHandler = new Laya.Handler(this, this.onTabSelected);//选中时执行函数
  this.topTab.selectedIndex = 1;//设置默认选中下标
  this.list.renderHandler = new Laya.Handler(this, this.updateListCell);//修改cell信息是调用,可与其余ui互调spa

  eg:游戏

    updateCellInfo(_cell:RebirthRecordCell, _index:number){
      _cell.updateCellInfo();
    }开发


  this.list.dataSource = [1,2,3,4,5];//数组长度就是加载的cell内容条数文档

  深刻:get

    switch (_index) {

      case 0:
        this.rankList.dataSource = AllCfg.getInstance().getRankingIds();

        break;
      case 1:
        this.rankList.dataSource = [];
        break;
      case 2:
        this.rankList.dataSource = this._worldRankData;
        break;
      default:
        break;
     }//切换时候从新渲染

  2.抽奖功能

    //能够利用tween 动做

Laya.Tween.to(this.rotatePart, {rotation:rotation}, 5000, Laya.Ease.cubicOut,Laya.Handler.create(this,this.tencost_onTweeed, [_response["data"]["spinItems"]]));

相关文章
相关标签/搜索