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

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

101. TypeScript Json 数据解析 [ 73%]

...:JSON; private onLoadConfigComplete(): void { this.wayPoints = Laya.loader.getRes("zxc.json") as JSON; console.log(this.wayPoints.name); //这里会报name 不存在 } 第二种方式 Laya.loader.load("zxc.json", Laya.Handler.create(this,function(){ this.wayPoints = Laya.loader.getRes("zxc.json") as...

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

102. 显示与切换图片(TypeScript-LayaAir基础篇(TS)-位图) [ 73%]

...更换纹理 this.ape.graphics.clear(); var texture: Texture = Laya.loader.getRes(textureUrl); this.ape.loadImage(textureUrl); // 设置交互区域 this.ape.size(texture.width, texture.height); } } } new laya.Sprite_SwitchTexture(); ``` 运行代码效果如动图2-2所示: ![动图2-2](img/2-2.g...

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

103. 为什么laya2.0加载不了.lm文件? [ 73%]

...mpleteHandler)); completeHandler(): void { Laya.stage.addChild(Laya.loader.getRes("LayaScene_Scene/Scene.ls")); Laya.stage.addChild(Laya.loader.getRes("LayaScene_Scene/Assets/BakerHouse/Models/Baker_house-Baker_house.lm")) } 在第二个addchild的时候报错了!!!! 2018-12-21 添加评论 ...

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

104. 【简单跑酷--JS版】---Lv.2 类之间的引用以及背景滚动实现 [ 72%]

...表中获取加载好的background图片纹理 var texture = Laya.loader.getRes('res/background.png'); //创建一个bg显示对象 var bg = new laya.display.Sprite(); //将上面的texture纹理绘制到bg图像里面 bg.graphics.drawTexture(texture, 0, 0); //将bg添加到舞台 Laya.stage.addChil...

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

105. 仅在Android微信小游戏下图片错乱 [ 72%]

...戏下图片错乱 static preLoadPublicAssets(){ this.sAssetList = Loader.getRes("file_list.json") Laya.loader.load("res/ui/share@atlas0.png", Handler.create(this, this.onLoaded), null, Loader.IMAGE, 1, true, null, true) } static onLoaded(res){ console.log("public assets inited !!!!") console.log(La...

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

106. 如何解析json文件并获取某对象值? [ 72%]

..., null, Loader.JSON); } private onLoaded() { var json : JSON = Laya.Loader.getRes("res/atlas/resTest0.json"); var jsTx = JSON.stringify(json); } 已经通过上面代码获取整个json内容,可我该如何获取我的json中的groups 数组的所有内容呢? 附件 : --> 2017-10-16 添加评...

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

107. 解析JSON格式的数据 [ 72%]

...aya.loader.load是预加载JSON字符串,并非是获取JSON Laya.loader.getRes是获取预加载过的JSON字符串 guoyiwei • 2016-07-26 14:25 @cuixueying:我看API上写的getRes()要传个资源地址,是要把fileURL传入吗,我试过不行呀 guoyiwei • 2016-07-26 14:28 @cuixueying:...

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

108. ios load后 声音播放问题 [ 72%]

...is, onLoading, null, false)); function onLoaded(){ console.log(Laya.loader.getRes(src)); }   在chrome,安卓下都是正常的,在ios和mac Safari下是undefined 放在一个sprite的click事件里 同样也是undefined   2017-08-11 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有...

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

109. htmlCanvas 像素级操作 [ 72%]

...sprite var img = new Laya.Sprite(); //img.graphics.drawTexture(Laya.loader.getRes(("../src/img/testImg.png"),0,0)); //获取图片资源 var tex = Laya.loader.getRes("../src/img/testImg.png"); //获取临时sprite的htmlCanvas var htmlCanvas = img.drawToCanvas(tex.width,tex.height,0,0); //获取临...

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

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

....loader.load预加载把302个图片资源加入到内存中,然后通过getRes 和 drawTexture 添加SPRITE对象到屏幕中。 预加载后的初始内存为29M左右 之后开始逐个添加SPRITE,在添加第1个到第80个头像的时候,内存显示稳定在29M 但是当添加第81个SP...

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