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

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

31. 加上size设置后,精灵不能点击. [ 73%]

...正常了. function createImg(){ var img = new Laya.Sprite(); var r = Math.random(); var s = r > 0.66 ? "img/flower1.jpg" : r > 0.33 ? "img/flower2.png" : "img/flower3.jpg" img.loadImage(s); img.on(Laya.Event.CLICK, this, () => { img.y -= 10; }) img.pos(100, 300) Laya.stage.addChild(img) } ...

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

32. 【简单跑酷--JS版】---Lv.3 添加地板 [ 73%]

...个素材是 32 * 20 拼起来的 this.y = 32 * 6 + 32 * parseInt(8 * Math.random()); if(this.bg == null){ //贴图纹理 this.bgTexture = Laya.loader.getRes("res/floor.png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); //将当前的坐标向上移动32 方便后面处理人物...

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

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

...lt; this._colorNums; i++) { let offset = i * 4; colorBuffer[offset] = Math.random(); colorBuffer[offset + 1] = Math.random(); colorBuffer[offset + 2] = Math.random(); colorBuffer[offset + 3] = 1; } //设置uniformbuffer this.batchMat.setBuffer("colormap", colorBuffer); } //随机生成_spriteNums数...

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

34. 为什么字符串不能连接? [ 71%]

为什么字符串不能连接? private getRandomColor():String { let arr:Array<String>=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; let str:String="#"; for(let i:number=0;i<6;i++){ let index:number=arr.length*Math.random(); str+=arr[index];//在IDE里面这句报...

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

35. 3d下阴影渲染问题求解 [ 70%]

...D.prototype = { creatBox:function(parent,poolBox,boxSize){ // var i = Math.random()*10; // var j = Math.random()*10; for (var i = 0; i < 10; i++) { for (var j = 0; j < 10; j++) { // var box = parent.addChild(new Laya.MeshSprite3D(new Laya.PlaneMesh(boxSize,boxSize,2,2))); var box = parent.addC...

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

36. 最新的ResourceVersion发布以后加载的url不正确 [ 70%]

...戏的流程如下: ResourceVersion.enable(     "version.json?" + Math.random(),     Handler.create(this, this.onVersonLoaded));   然而发布的游戏启动后发现加载失败,查看日志发现加载的URL拼得不对:   它加载使用的路径是一个奇怪的: http://localhost...

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

37. flash中的RandomAS在Layaair里面是用哪个函数替代了呢? [ 69%]

flash中的RandomAS在Layaair里面是用哪个函数替代了呢? 2018-04-10 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 w1114367261 赞同来自: Math.random()返回0~number-1之间的随机数 和Random...

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

38. list随机生成图片优化 [ 67%]

list随机生成图片优化 var aa:int= Math.floor((Math.random()*4)+1); var bb:int; switch(aa) { case 1: bb=2; break; case 2: bb=4; break; case 3: bb=1; break; case 4: bb=3; break; } var img:Image = cell.getChildByName("img1") as Image; img.skin ="battle/xuanshangyu/Image_"+aa+"00"+bb+".png"; 一...

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

39. list功能改变图片皮肤 [ 66%]

...<130;q++){ var first:Object= new Object(); //first.lbl =Math.floor(Math.random()*3+1) ; if(q == 1) { var cc:*=_tempFruitUi.panel; var dd:List=aa.getChildByName("firstList") as List; var itemB:Box = dd.getCell(0); var specificPic:Image = itemB.getChildByName("img1") as Image; specificPic.skin = "b...

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

40. 为什么这个图片还是随机切换不了,新手求帮忙 [ 66%]

...  以下代码是用Image的skin来替换资源var index= Math.floor(Math.random()*num); var img= new Laya.Image(); Laya.stage.addChild(img); img.skin = "res/"+index+".png"; 2017-01-11 1 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 Todo...

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