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

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

21. 点击区域问题 [ 85%]

...on spHandler() {     sp.graphics.clear();     var rc:number = Math.floor(Math.random()*0xffffff);     sp.graphics.drawRect(-50,-100,100,100,"#"+rc); } 这样多包几层,点击区域就会怪怪的,绘制的区域和点击区域不一样,不知道是不是我理解的有问题 2018...

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

22. UI-ProgressBar [ 83%]

...value += 0.05; } function onChange(value) { console.log("进度:" + Math.floor(value * 100) + "%"); } })();module laya { import Stage = Laya.Stage; import ProgressBar = Laya.ProgressBar; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_ProgressBar { private progressBar: Pr...

来源: Laya_示例 发布时间: 20260303

23. UI-ProgressBar [ 82%]

...gressBar.value += 0.05; } onChange(value) { console.log("进度:" + Math.floor(value * 100) + "%"); } } new UI_ProgressBar();module laya { import Stage = Laya.Stage; import ProgressBar = Laya.ProgressBar; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_ProgressBar { priva...

来源: Laya2.0_示例 发布时间: 20260303

24. 大神们能不能帮忙解决一下一些问题呀,一个新手搞不定呀 [ 81%]

...的关数 = [1,2,3,4,5,6,7]; if(第一关过关了){ var 随机数 = Math.floor(Math.random() * 未过的关数.length; var 新的未过的关数 = []; var 剩下关数 = 未过的关数.length - 1; for(var i =0;i<剩下关数;i++){ if(i != 随机数){ 新的未过的关数.push(未过的关数[i...

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

25. [LayaAirIDE3]咋么实现鼠标点击角色移动 [ 78%]

... (this.loadedClips.length > 0) { const clipPath = this.loadedClips[Math.floor(Math.random() * this.loadedClips.length)]; this.playMcClip(clipPath); } else { // 兜底:用 Animator2D 状态机 const idx = Math.floor(Math.random() * 8) + 1; this._animator?.play(`move${idx}`); } } /* -------------...

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

26. 我用的HBox做的进度条为啥总是一闪一闪的。 [ 78%]

...啊 public onChange(value: number): void { console.log("进度:" + Math.floor(value * 100) + "%"); var num:number = Math.floor(value*100); // this.updateFont(num); this.updateFont(100); //test用 // if(num==100){ // G.I.loginManager.preload(); // } } private hbox:Laya.HBox; private updateFont(valu...

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

27. 路径显示会添加DrawCall,每增加一条路径都会添加,有什么办法降DrawCall [ 78%]

...h.PI * 180; _path2.pos(a.x,a.y); this.addChild(_path2); var len:int = Math.floor(GetPathLen()/PATH_LEN)+2; SetPathArr(arr,_path); SetPathArr(arr2,_path2); //注释下面这行就正常了 _path.scrollRect = new Rectangle(0,0,(len-3)*PATH_LEN-30,58); _path2.scrollRect = new Rectangle(0,0,(len-3)*PATH...

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

28. ios旋转问题 [ 78%]

...width != 640) { var ratio:Number = width / 640; width = 640; height = Math.floor(height / ratio); } if (height > 1280) height = 1280; else if (height < 960) height = 960;*/ var browerRatio:Number = width / height ; if( height != 1136 ) { // w 640 // h 1136 var ratioW:Number = height / 1136 ; h...

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

29. 3D中的Animator如何从指定的某一帧开始播放动画 [ 77%]

...val:int = 1 / animator.cacheFrameRate; //总帧数 var endFrame:int = Math.floor(maxTime / frameInterval); //计算开始帧 var startFrame:int = Math.floor(endFrame * (1 - percent)); animator.addClip(totalAnimationClip,"runShoot",startFrame); animator.on(Event.STOPPED, this, this.removeClip); anima...

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

30. 骨灰级的bug [ 75%]

... 222行 , 二二二。。。。。 _currentKeyframeIndex = Math.max(Math.floor(currentPlayTime / cacheFrameInterval), 0);//TODO:矫正   修正后的正确值: _currentKeyframeIndex = Math.round(currentPlayTime / cacheFrameInterval);//TODO:矫正     不修正的话,此条件一直不会满...

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