大约有 620 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0046 秒)
Laya_社区(477) Laya2.0_文档(51) Laya3.0_api(50) Laya2.0_示例(16) Laya_示例(12) Laya3.0_文档(10) laya_api(2) Laya2.0_api(2)
...: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
...更换纹理 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所示: ); 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
...表中获取加载好的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
...戏下图片错乱 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
..., 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
...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
...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
...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
....loader.load预加载把302个图片资源加入到内存中,然后通过getRes 和 drawTexture 添加SPRITE对象到屏幕中。 预加载后的初始内存为29M左右 之后开始逐个添加SPRITE,在添加第1个到第80个头像的时候,内存显示稳定在29M 但是当添加第81个SP...
来源: Laya_社区 发布时间: 20161107