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

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

1. 2.x引擎项目升级说明 · LayaAir3.4 · 引擎文档 · LAYABOX [ 100%]

2.0引擎开发者使用3.0的差异汇总1、LayaAir3.0 Loader修改1.1加载一个资源1.2 加载多个资源(用数组)1.3 加载多个文件(组合)1.5 加载HTMLImage1.6 使用Options。1.7 预制体/场景的问题1.8 旧版本引擎load和create的兼容性问题1.9扩展Loader能...

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

2. 预制体模块 · LayaAir3文档 · LAYABOX [ 95%]

... constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label ); } ); } } 运行效果如图3-6所示 (图3-...

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

3. 如何使用javascript版本的加载模式 [ 95%]

....json 那我先引用了LayaUI.max.all.js后,再加载ui.json!   Laya.loader.load([ { url: config.layerUIJson, type: Laya.Loader.JSON } ], Handler.create(this, function () { this.gameScenes = new ui.layer.gameScenesUI(); this.addChildren(this.gameScenes); })); 但页面上却没有任何内容...

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

4. 预制体 · LayaAir3.4 · 引擎文档 · LAYABOX [ 95%]

... constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); //添加预制体Label字体到box节点下 this.box.addChild( label ); } ); } } 运行效果如图3-6所示 (图3-...

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

5. 淘宝小游戏 · LayaAir3.4 · 引擎文档 · LAYABOX [ 92%]

...在代码中加载分包,是可以加载到分包内的资源的: Laya.loader.load("sub1/Cube.lh").then((res: Laya.PrefabImpl) => { // ...... }); Laya.loader.load("sub2/Sphere.lh").then((res: Laya.PrefabImpl) => { // ...... }); 4.2 特殊情况下多级目录的分包 有时开发者的分...

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

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

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

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

7. Cannot read property 'load' of null [ 91%]

...ayaAir引擎 Cannot read property 'load' of null 查了断点,看到Laya.loader是null,为什么会出现为null的情况?  代码如下: class main{ constructor(){ MapManager.getInstance().LoadMapResource(); } } new main(); class MapManager { private static s_instance = null; public static g...

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

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

...此方法只执行一次 */ 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

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

...毕,此方法只执行一次 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

10. 弹窗视图组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 81%]

...nMouseClick(): void { //使用Prefab,需要转换根节点为Dialog Laya.loader.load("resources/Prefab2D.lh").then(res => { let dlg: Laya.Dialog = res.create(); dlg.open(); }); } } 运行效果如下: (动图) 二、通过代码创建Dialog 在进行书写代码的时候,免不了通过...

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