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

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

1. 定时器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...null, coverBefore: boolean = true, jumpFrame: boolean = false): void { var handler: TimerHandler = this._create(false, true, delay, caller, method, args, coverBefore); if (handler) handler.jumpFrame = jumpFrame; } 使用示例如下: const { regClass } = Laya; import { RuntimeScriptBase } from "./...

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

2. 事件管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 98%]

...型 Laya.Event2.2 事件派发 Laya.EventDispatcher2.3 事件处理 Laya.Handler3. 自定义的事件事件管理 1. 认识事件 1.1 什么是事件 事件Event指的是由系统事先设定的、能被对象识别和响应的动作,事件是指对象对于外部动作的响应,当对方发生...

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

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

...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

4. 缓动 · LayaAir3.3 · 引擎文档 · LAYABOX [ 84%]

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

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

5. 获取位置信息 · LayaAir3.3 · 引擎文档 · LAYABOX [ 83%]

...BLE和Geolocation.TIMEOUT之一。 */ static getCurrentPosition(onSuccess: Handler, onError: Handler = null): void { Geolocation.navigator.geolocation.getCurrentPosition(function (pos: any): void { Geolocation.position.setPosition(pos); onSuccess.runWith(Geolocation.position); }, function (error: an...

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

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

... //加载引擎需要的资源 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. 二次开发 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

...etString( "value" )); } catch (JSONException e) { e.printStackTrace(); } m_Handler.post( new Runnable() { public void run() { //ui thread update ui JSONObject obj = new JSONObject(); try { obj.put("value", "Hello JS!"); } catch (JSONException e) { e.printStackTrace(); } ExportJavaFunction.CallBackTo...

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

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

...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

9. AI编码环境:CodingMCP · LayaAir3.3 · 引擎文档 · LAYABOX [ 53%]

...` 前缀**访问所有引擎类和静态方法。 ✅ `Laya.Sprite`, `Laya.Handler.create(...)` ❌ `Sprite`, `Handler` --- ## 入口规范 (Entry.ts) 入口函数结构固定,禁止修改: ```typescript export async function main() { /* 正式初始化逻辑 */ } ``` ❌ 禁止提交测试代...

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

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

...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