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

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

41. laya.net.Loader [ 67%]

...I DocumentationAll Packages | All Classes | Index | Frames No Frames LoaderProperties | Methods | Events | Constants Packagelaya.netClasspublic class LoaderInheritanceLoader EventDispatcher Object Loader 类可用来加载文本、JSON、XML、二进制、图像等资源。 Public Properti...

来源: Laya2.0_api 发布时间: 20190513

42. playSound和playMusic结束时候有异常抛出 [ 66%]

playSound和playMusic结束时候有异常抛出 1. loader加载了{url:"res/music/Music_start.mp3",type:Laya.Loader.SOUND}资源 2. 加载结束后,调用Laya.SoundManager.playSound("res/music/Music_start.mp3") 3. 声音播放完成后,系统抛出异常__proto._tryClearBuffer=function(sourceN...

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

43. 嵌入字体 · LayaAir3.4 · 引擎文档 · LAYABOX [ 65%]

...成功'); } else { log('字体注册失败'); } } 4.2 方法二 通过ttfloader下载远程字体文件,注册时传入的字体名称为ttf文件名。 Laya.loader.load("res/maobi.ttf", Loader.TTF).then(() => { var label: Label = new Label(); label.font = "maobi"; label.text = "自定义嵌入...

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

44. 微信小游戏 · LayaAir3.4 · 引擎文档 · LAYABOX [ 63%]

...小游戏中加载资源,如果引用的是本地路径,比如: Laya.loader.load("resources/layaair.png"); 如果项目的目录中,全部大小加起来不超过4M的话,只要能找到本地的资源,怎么写也没问题。 但是,微信小游戏的本地包有4M的限制,一旦...

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

45. Spine3D渲染器 · LayaAir3.4 · 引擎文档 · LAYABOX [ 63%]

...载Spine动画数据资源(json文件),注意一定要设置为Laya.Loader.SPINE类型,否则不会把json认为是SPINE资源 Laya.loader.load("girl2/mix-and-match-pro.json", Laya.Loader.SPINE).then(() => { // 添加Spine3D渲染器组件到3D精灵节点上 this.spine3D = this.owner.add...

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

46. 通过laya设计模式制作的,要怎么给按钮绑定事件呢? [ 63%]

...olor = "#101825"; this.init() } init() { // 预加载图集 Laya.loader.load("res/atlas/comp.atlas", Laya.Handler.create(this, this.onLoaded ), null, Laya.Loader.ATLAS) } onLoaded(){ Laya.stage.addChild(new TopUI()) Laya.stage.addChild(new TabUI()) this.getGold.on(Laya.Event.MOUS...

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

47. 动态图集 · LayaAir3.4 · 引擎文档 · LAYABOX [ 62%]

...,指定添加到哪个大纹理。 //使用示例 const texture = Laya.loader.getRes("resources/hero.png", Laya.Loader.IMAGE); const success = atlasManager.addTexture(texture, 0.5, 0); // 添加到指定图集,缩放为 0.5 通过 URL 添加纹理 //接口 addTextureByUrl(url: string, scale: numbe...

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

48. 抖音小游戏 · LayaAir3.4 · 引擎文档 · LAYABOX [ 61%]

...此方法只执行一次 */ onAwake(): void { //小游戏加载分包 Laya.loader.loadPackage("sub1", this.printProgress).then(() => { Laya.loader.load("sub1/Cube.lh").then((res: Laya.PrefabImpl) => { let sp3: Laya.Sprite3D = res.create() as Laya.Sprite3D; this.scene3d.addChild(sp3); }); }) La...

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

49. 支付宝小游戏 · LayaAir3.4 · 引擎文档 · LAYABOX [ 61%]

...毕,此方法只执行一次 onAwake(): void { //支付宝小游戏 Laya.loader.loadPackage("sub1", this.printProgress).then(() => { Laya.loader.load("sub1/Cube.lh").then((res: Laya.PrefabImpl) => { let sp3: Laya.Sprite3D = res.create() as Laya.Sprite3D; this.scene3d.addChild(sp3); }); }) La...

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

50. 使用二进制图片 · LayaAir3.0文档 · LAYABOX [ 60%]

...图片加密数据是在图片的前面写入了四个字节的数据 Laya.loader.fetch("resources/res/test.bin","arraybuffer").then((res)=>{ //获得res的ArrayBuffer数据 let arraybuffer: ArrayBuffer = res; //Byte数组接收arraybuffer let byte:Byte = new Byte(arraybuffer); //从第四个字...

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