• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 84 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0055 秒)

71. 3D性能优化 · LayaAir3.4 · 引擎文档 · LAYABOX [ 51%]

...Position(positionRanvge); //随机一个颜色索引 let colorIndex = Math.floor(Math.random() * this._colorNums); //设置节点的 Laya.ENodeCustomData.custom_0 为对应的颜色索引 render.setNodeCustomData(Laya.ENodeCustomData.custom_0, colorIndex); } } private _getRandomPosition(positionRanv...

来源: Laya3.0_文档 发布时间: 20251010

72. laya 的list组件,如果有多页信息,怎么实现翻页丫?? [ 50%]

... this.list_rule.scrollBar.max / this.list_rule.totalPage; let index = Math.floor(value / page) if (index > 5) index = 5; this.setCurPage(index) } public onMouse(e: Laya.Event, index: number): void { if (e.type == Laya.Event.MOUSE_DOWN) { this.m_downValue = this.list_rule.scrollBar.value; } else i...

来源: Laya_社区 发布时间: 20180724

73. 请问laya有没有类似翻页容器(pageView)的组件? [ 48%]

... this.list_rule.scrollBar.max / this.list_rule.totalPage; let index = Math.floor(value / page) if (index > 5) index = 5; this.setCurPage(index) } public onMouse(e: Laya.Event, index: number): void { if (e.type == Laya.Event.MOUSE_DOWN) { this.m_downValue = this.list_rule.scrollBar.value; } else i...

来源: Laya_社区 发布时间: 20170215

74. 分享:LayaAir下Loading进度条的制作(ActionScript 3.0) [ 48%]

...r); } private function onChange(value:Number):void { trace("进度: "+Math.floor(value*100)+"%"); } //游戏资源加载进度函数 private function onProgress(pro:Number):void { trace("加载了总文件的:"+pro+"%") progressBar.value=pro; if(progressBar.value==1) { progressBar.value=1; } } } }...

来源: Laya_社区 发布时间: 20160509

75. 分享,扩展Laya.Text组件实现简单的富文本 [ 48%]

...overflow != Text.VISIBLE) { var func = this.overflow == Text.HIDDEN ? Math.floor : Math.ceil; lineCount = Math.min(lineCount, func((this.height - this.padding[0] - this.padding[2]) / (this.leading + this._charSize.height))); }; var startLine = this.scrollY / (this._charSize.height + this.leading) | ...

来源: Laya_社区 发布时间: 20180417

76. 关于大量图片加载绘制后的内存暴增的疑问 [ 47%]

...制并排序 if(texture) { sp.graphics.drawTexture(texture,(num-1)*70,Math.floor((num-1)/10)*70+10); } } private function chageTexture():void { //如果图片的张数超出100,将不再执行 if(num>=100) { Laya.timer.clear(this,onLoop); return; } //绘制下一张图片 ++num; //拼写图集...

来源: Laya_社区 发布时间: 20161107

77. zip更新模式缓存是怎么读取的?? [ 45%]

... (total:number,now:number,speed:number)=>{ onEvent('downloading',Math.floor((now/total)*100),null); return false; }, //完成回调 (curlret:number,httpret:number)=>{ if(curlret!=0 || httpret<200||httpret>=300){ onEvent('downloadError'); //throw 'download error'; }else{ onEvent('download...

来源: Laya_社区 发布时间: 20180108

78. 缓动动画(JavaScript-LayaAir基础篇(JS)-动画基础) [ 40%]

...更新方法 * txt 缓动对象 */ function updateColor(txt){ var c = Math.floor(Math.random()*3); switch (c) { case 0: txt.color = "#eee000"; break; case 1: txt.color = "#ffffff"; break; case 2: txt.color = "#ff0000"; break; default: txt.color = "#eee000"; break; } } /** * 缓动完成后的回调...

来源: Laya2.0_文档 发布时间: 20210715

79. 缓动动画(TypeScript-LayaAir基础篇(TS)-动画基础) [ 39%]

...动对象 */ private updateColor(txt:Laya.Text):void{ var c:number = Math.floor(Math.random()*3); switch (c) { case 0: txt.color = "#eee000"; break; case 1: txt.color = "#ffffff"; break; case 2: txt.color = "#ff0000"; break; default: txt.color = "#eee000"; break; } } /** * 缓动完成后的回调...

来源: Laya2.0_文档 发布时间: 20210715

80. socket大型项目回调 [ 39%]

...); if (id) { // 7.x do { var tmp:number = id % 128; var next:number = Math.floor(id / 128); if (next != 0) { tmp = tmp + 128; } buffer.writeByte(tmp); id = next; } while (id != 0); // 5.x // var len:Array = []; // len.push(id & 0x7f); // id >>= 7; // while(id > 0) // { // len.push(id &a...

来源: Laya_社区 发布时间: 20180119