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

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

1. 使用百度地图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...Geolocation.enableHighAccuracy = true; Laya.Geolocation.watchPosition(Laya.Handler.create(this, this.updatePosition), Laya.Handler.create(this, this.onError)); // 绑定convertToBaiduCoord作用域 this.convertToBaiduCoord = this.convertToBaiduCoord.bind(this); } } 由于本例不需要使用LayaAir...

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

2. TiledMap地图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 99%]

...is.tMap.createMap("resources/TiledMap/orthogonal.json", viewRect, new Laya.Handler(this, this.completeHandler)); } //添加地图到Scene2D下 private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHa...

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

3. 场景管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...open(url: string, closeOther: boolean = true, param: any = null, complete: Handler = null, progress: Handler = null): Promise<Scene> { Scene.showLoadingPage(); return Scene.load(url, Handler.create(null, this._onSceneLoaded, [closeOther, complete, param]), progress); } (图2-1) 例如创...

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

4. 3D场景环境设置 · LayaAir3.3 · 引擎文档 · LAYABOX [ 87%]

...nderer; //加载相机天空盒材质 Laya.Material.load("sky2.lmat", Laya.Handler.create(null, function(mat: any) { //修改天空盒渲染器的天空盒材质 skyRenderer.material = mat; })); 2.3 IDE中创建天空盒 2.3.1 更改IDE默认的球形天空盒 当我们用IDE场景一个3D场景时...

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

5. 缓动 · LayaAir3.3 · 引擎文档 · LAYABOX [ 85%]

...以避免因对象重用而引发的问题。此外,新系统不再使用Handler,从而杜绝了Handler重用带来的混乱。同时,改进后的Tween系统支持更丰富的选项以及串行和并行任务功能,为开发者提供更灵活强大的工具来实现理想的动画效果。 ...

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

6. 多线程Worker · LayaAir3.3 · 引擎文档 · LAYABOX [ 79%]

... //加载引擎需要的资源 Laya.loader.load("../atlas/comp.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例UI界面 var testView:ui.test.TestPageUI = new ui.test.TestPageUI(); Laya.stage.addChild(testView); } } new LayaUISample; WorkerLoader.workerPath = "libs...

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

7. 2D性能优化 · LayaAir3.3 · 引擎文档 · LAYABOX [ 58%]

...var sp=new Laya.Sprite(); sp.loadImage("res/apes/monkey2.png",0,0,0,0,Laya.Handler.create(this,function() { console.log(sp.width,sp.height); })); Laya.stage.addChild(sp); loadImage在加载完成的回调函数触发之后才可以正确获取宽高。 直接调用size设置: Laya.loader.load("res...

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

8. 和原生Dom交互 · LayaAir3.3 · 引擎文档 · LAYABOX [ 58%]

...x.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,this.clickHandler); this.qrcodeSp = new Laya.Sprite(); Laya.stage.addChild(this.qrcodeSp); 编译运行上面的代码,然后点击舞台可以看到,二维码已经显示到了舞台上,可以用手机扫下,发现手机已经...

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

9. 3D粒子 · LayaAir3.3 · 引擎文档 · LAYABOX [ 48%]

...("Game start"); //加载粒子特效资源 Laya.loader.load(this.filePath, Handler.create(this, () => { })); } //每次鼠标点下屏幕后,会创建一个特效 mouseDown(e: Event): void { var particle = Particle3D.Create(this.filePath); this.owner.addChild(particle); } //鼠标抬起后,...

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

10. 3D粒子编辑模块 · LayaAir3文档 · LAYABOX [ 48%]

...("Game start"); //加载粒子特效资源 Laya.loader.load(this.filePath, Handler.create(this, () => { })); } //每次鼠标点下屏幕后,会创建一个特效 mouseDown(e: Event): void { var particle = Particle3D.Create(this.filePath); this.owner.addChild(particle); } //鼠标抬起后,...

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