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

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

1. 插件开发说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...estField") export class TestField extends IEditor.PropertyField { @IEditor.onLoad static async onLoad() { await gui.UIPackage.resourceMgr.load("MyField.widget"); } create() { let input = gui.UIPackage.createWidgetSync("MyField.widget"); return { ui: input }; } refresh() { //这里负责将数据设...

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

2. 启动画面LoadingView · LayaAir3.3 · 引擎文档 · LAYABOX [ 99%]

...下: var nPercent=0; var image1 = document.createElement('img'); image1.onload=function() { if(window.loadingView){ nPercent+=33; window.loadingView.loading(nPercent); } } image1.src = "a.png"; var image2 = document.createElement('img'); image2.onload=function() { if(window.loadingView){ nPercent+...

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

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

... { var xmlreq = new XMLHttpRequest(); xmlreq.responseType = "text"; xmlreq.onload = function (e) { var data = e.currentTarget.response; self.postMessage(data); } xmlreq.open("get","../atlas/comp.json"); xmlreq.send() }, false); 这个例子是在worker中进行加载文件,加载完毕传给主进...

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

4. TiledMap地图 · LayaAir3.3 · 引擎文档 · LAYABOX [ 93%]

...andler(this, this.completeHandler)); } //添加地图到Scene2D下 private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHandler(e: any = null): void { this.onLoaded(); } } 编译运行代码,效...

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

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

...("get", "res/atlas/comp.png", true); xhr.responseType = "arraybuffer"; xhr.onload = function () { if (this.status == 200) { var blob = new Blob([this.response], { type: "image/png" }); var img = document.createElement("img"); img.onload = function (e) { window.URL.revokeObjectURL(img.src); // 清除...

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

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

...Laya.Scene.open("scene/Game.ls",true, null, Laya.Handler.create(this, this.onLoaded), Laya.Handler.create(this, this.onLoading)); //关闭指定的场景 Laya.Scene.close("scene/Login.ls") //销毁指定的场景 Laya.Scene.destroy("scene/Login.ls") 8.2 场景资源加载 示例代码如下: //用...

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

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

...le.files.length){ fileReader.readAsDataURL(file.files[0]); } }; fileReader.onload = function(evt):void { if(Laya.Browser.window.FileReader.DONE == fileReader.readyState) { var sp:Laya.Sprite = new Laya.Sprite(); sp.loadImage(fileReader.result,0,0,300,300); Laya.stage.addChild(sp); } } } } new Main; ...

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

8. 预制体模块 · LayaAir3文档 · LAYABOX [ 57%]

...2D,3D资源 Laya.loader.load(resArr, null, Laya.Handler.create(this, this.onLoading, null, false)).then(() => { // 加载完成后,处理逻辑 this.progress.value = 0.98; console.log("加载结束", this.progress.value); //预加载的东西太少,为了本地看效果延迟一秒,真实...

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

9. 预制体 · LayaAir3.3 · 引擎文档 · LAYABOX [ 57%]

...2D,3D资源 Laya.loader.load(resArr, null, Laya.Handler.create(this, this.onLoading, null, false)).then(() => { // 加载完成后,处理逻辑 this.progress.value = 0.98; console.log("加载结束", this.progress.value); //预加载的东西太少,为了本地看效果延迟一秒,真实...

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

10. HTTP通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 39%]

...rcent.toFixed(2) + '%'); } }); // 设置请求完成后的处理函数 xhr.onload = function () { if (xhr.status === 200) { console.log("文件下载完成!"); } else { console.error("请求失败: " + xhr.status); } }; // 设置请求失败的处理函数 xhr.onerror = function () { console.error...

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