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

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

131. 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

132. 写的更换纹理的代码不生效,大佬帮忙看一下。(工程附件已经上传) [ 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

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

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

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

134. 打包之后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

135. 图集打包后使用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

136. 设置遮罩(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

137. 设置遮罩(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

138. [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

139. swf在layaairts里播放的问题,播放不了,swf在群文件star.swf [ 60%]

...文档的例子试了不行 // 程序入口 module laya {     import Loader = Laya.Loader;     import Handler = Laya.Handler;     export class Loader_MultipleType {         private ROBOT_DATA_PATH: string = "res/swf/star.swf"; private ROBOT_DATA_PATHS: string = "res/swf/star.json...

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

140. 关于创建Sprite获取大小 [ 60%]

...调。这个是异步获取,如果你要单个获取的话 window.Laya.loader.load(value.url, ls.Handler.create(this, function () { _this.graphics.clear() var texture = window.Laya.loader.getRes(value.url) _this.graphics.drawTexture(texture) _this.scaleX = _this.set_width / texture.sourceWidth _th...

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