LayaAir开发

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

一、LayaBox引擎开发各组件作用

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

二、开发过程遇到的问题

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

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

  eg:

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


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

  深入:

    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"]]));

 

  

转载于:https://www.cnblogs.com/dr-zhou/p/6670453.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值