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

大约有 7 项符合查询结果, 库内数据总量为 30,723 项。 (搜索耗时: 0.0040 秒)

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

...", 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); // 清除释放; }; img.src = window...

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

2. 通用发布 · LayaAir3.0文档 · LAYABOX [ 95%]

...使用远程包 Laya.loader.loadPackage("sub1","http://192.168.56.1:2840/",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); }); }) Laya.loader.loadPackage("sub2","htt...

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

3. 3D寻路 · LayaAir3.0文档 · LAYABOX [ 87%]

...通过下面的代码,可以初始化A*的地图数据 //读取地形图 this.aStarMap = Loader.getTexture2D("res/threeDimen/scene/TerrainScene/Assets/AStarMap.png"); //获得地图数据 var aStarArr = this.createGridFromAStarMap(this.aStarMap); //使用astar初始化地图数据 this.graph = new...

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

4. 引用第三方JS模块 · LayaAir3.0文档 · LAYABOX [ 84%]

..., 1, 0, 1, 0, 1, 0], [0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 1, 0, 0, 0, 0, 0] ]; this.aStarInstance = new AStarFinder({ grid: { // 列主序矩阵 matrix: myMatrix } }); let startPos = { x: 0, y: 0 }; let goalPos = { x: 7, y: 7 }; let myPathway = this.aStarInstance.findPath(startPos, goalPos); console.log...

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

5. 网络通信 · LayaAir3.0文档 · LAYABOX [ 82%]

...象所封装的原生 XMLHttpRequest 引用。 */ get http(): any { return this._http; } 通过 ._http 属性可以获得XMLHttpRequest。XMLHttpRequest 中文可以解释为可扩展超文本传输请求。它为客户端提供了在客户端和服务器之间传输数据的功能。它提供了一...

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

6. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 71%]

...必须的 @IEditorEnv.regClass() export class TestSceneScript { //注意:this是当前的IEditorEnv.IGameScene对象,如果不需要,也可以省略这个声明 static test(this: IEditorEnv.IGameScene, msg: string) { console.log(msg); //hello return "ok"; } } //下面是UI进程的代码 let r...

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

7. 2.x引擎项目升级指南 · LayaAir3.0文档 · LAYABOX [ 56%]

...事件监听方式和Laya.Script命名函数方式处理输入。例如: this.aNode.on(Laya.Event.CLICK, ()=> { console.log("clicked"); }); class MyScript extends Laya.Script { //脚本事件 onMouseClick(e:Event) { console.log("clicked"); } } aNode.addComponent(MyScript); 以上两种方式是...

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