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

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

131. 微信小游戏加载资源问题 [ 62%]

...) { if (window.navigator.userAgent.indexOf('MiniGame') < 0) { Laya.Laya.loader.load(fileUrl, callBack); } else { if (fileType == Laya.Loader.IMAGE || fileType == Laya.Loader.SOUND) MiniFileMgr.downOtherFiles(fileUrl, callBack, fileUrl, true, false); else MiniFileMgr.downFiles(fileUrl, encoding, c...

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

132. layaAir如何实现for循环加载多张图片,并且通过事件按比例缩小 [ 62%]

...。layaair折腾半天,搞不明白image组件,sprite.loadImage,Laya.loader.load如果用for循环操作,响应事件中用什么方法指向事件的发起对象?原来用e.target和e.data。现在事件发起者和加载的数据怎么得到呢?(不用循环可以用直接用变量...

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

133. Naitve下解析xml出错 [ 62%]

...ative模式下,使用 var protocols = Laya.Utils.parseXMLFromString(Laya.loader.getRes(url)).firstChild;这样的方式,可以获取到xml对象,调用protocols.children.length没有问题。但是在native模式下。获取出来的对象调用protocols.children.length出错。说是protocols...

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

134. 写的更换纹理的代码不生效,大佬帮忙看一下。(工程附件已经上传) [ 62%]

...cs.clear();                 var t: Laya.Texture = Laya.loader.getRes("puzzlePic/pi-" +this.levelNum +"-"+this.owner.name.slice(4,1)+ "-2.png");                 (this.owner as Laya.Sprite).graphics.drawTexture(t,0,0);   2020-10-12 0 0 分享 微博 QZONE 微...

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

135. 小游戏对读取json文件有要求吗?为啥说读取json文件错误啊 [ 61%]

...0 0 分享 微博 QZONE 微信 liwenhua 赞同来自: this.linkJson = Laya.loader.getRes('res/json/linkUrl.json');这样读取出来不就是就对象了吗,怎么设置编码格式啊??不会啊!!!我都是这样引用,然后直接this.linkJson.XXX进行读取的,如果数值都都...

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

136. 打包之后TEXT可以显示但是 加载其他资源时白屏 [ 61%]

...";  var asset = []; asset.push({ url: ["../res/image/bg.png"], type: Laya.Loader.IMAGE }); Laya.loader.load(asset,Laya.Handler.create(this,graphicsImg)); function graphicsImg(){ var s = new laya.display.Sprite(); s.graphics.drawTexture(Laya.loader.getRes("../res/image/bg.png"),0,0);  Laya.stage.ad...

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

137. 图集打包后使用Texture不显示啊 [ 61%]

...=================================================== // 程序入口 import Loader = Laya.Loader; import Texture = Laya.Texture; import Handler = Laya.Handler; class GameMain{ constructor() { Laya.init(1080,1321); //设置适配模式 Laya.stage.scaleMode = "showall"; //设置剧中对齐 Laya.stage....

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

138. 设置遮罩(JavaScript-LayaAir基础篇(JS)-位图) [ 61%]

...源加载成功后,通过回调方法绘制图片并添加到舞台 Laya.loader.load(Res,Handler.create(this,graphicsImg)); })(); function graphicsImg() { img = new Sprite(); //获取图片资源,绘制到画布 img.graphics.drawTexture(Laya.loader.getRes(Res),150,50); //添加到舞台 Laya.sta...

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

139. 设置遮罩(TypeScript-LayaAir基础篇(TS)-位图) [ 60%]

...源加载成功后,通过回调方法绘制图片并添加到舞台 Laya.loader.load(this.Res,Laya.Handler.create(this,this.graphicsImg)); } private graphicsImg():void{ this.img = new Laya.Sprite(); //获取图片资源,绘制到画布 this.img.graphics.drawTexture(Laya.loader.getRes(this.Res),1...

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

140. [LayaAir3]Spine释放后,纹理不会被释放掉 [ 60%]

...              let pngUrl = texture.realTexture.url; let res = Laya.loader.getRes(pngUrl);         if (res && res._bitmap instanceof Laya.Texture2D) {             res._bitmap.destroy();         }         Laya.loader.clearRes(pngUrl)            }     } tmpDat.d...

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