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

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

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

...通过下面的代码,可以初始化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

2. 位图切片组件 · LayaAir3.0文档 · LAYABOX [ 99%]

...和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.clip.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); // 位置 this.clip.skin = "atlas/comp/clip_num.png"; // 皮肤 this.clip.interval = 1000; // 切片动画的播放时间间隔1000毫秒 this.clip.clipX...

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

3. 使用3D精灵 · LayaAir3.0文档 · LAYABOX [ 98%]

... 节点对象。 */ getChildByName(name: string): Node { for (let child of this._children) { if (child && child.name === name) return child; } return null; } 当我们找到子节点时,也可以对节点做一些基础操作,比如删除掉自己方法 removeSelf() /** * 从父容器删...

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

4. 使用百度地图 · LayaAir3.0文档 · LAYABOX [ 98%]

...div容器 二、接着是构造函数: constructor() { Laya.init(1, 1); this.init(); // 使用高精度位置 Laya.Geolocation.enableHighAccuracy = true; Laya.Geolocation.watchPosition(Laya.Handler.create(this, this.updatePosition), Laya.Handler.create(this, this.onError)); // 绑定convertToBaidu...

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

5. 垂直布局容器组件 · LayaAir3.0文档 · LAYABOX [ 97%]

...和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.vbox.pos(100, 100); this.vbox.bgColor = "#ffffff"; this.vbox.space = 30; this.vbox.align = "center"; } } 二、通过代码创建VBox 有时,需要用代码管理UI,创建UI_VBox类用于创建VBox组件。由于单独...

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

6. 水平布局容器组件 · LayaAir3.0文档 · LAYABOX [ 97%]

...和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.hbox.pos(100, 100); this.hbox.bgColor = "#ffffff"; this.hbox.space = 100; this.hbox.align = "middle"; } } 二、通过代码创建HBox组件 有时,需要用代码管理UI,创建UI_HBox类用于创建HBox组件。由...

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

7. TiledMap地图 · LayaAir3.0文档 · LAYABOX [ 97%]

...aya.Script { private tMap:Laya.TiledMap; onEnable() { //创建地图对象 this.tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Laya.Rectangle = new Laya.Rectangle(0, 0, Laya.stage.designWidth, Laya.stage.designHeight); //创建TiledMap地图 this.tMap.createMap("reso...

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

8. 定时器 · LayaAir3.0文档 · LAYABOX [ 97%]

...。 * @param delay 延迟几帧(单位为帧)。 * @param caller 执行域(this)。 * @param method 定时器回调函数。 * @param args 回调参数。 * @param coverBefore 是否覆盖之前的延迟执行,默认为 true 。 */ frameOnce(delay: number, caller: any, method: Function, args: any[...

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

9. 输入文本组件 · LayaAir3.0文档 · LAYABOX [ 97%]

...组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.txtin.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.txtin.size(500, 60); //大小 this.txtin.pivot(this.txtin.width/2, this.txtin.height/2); //轴心点 this.txtin.font = "宋体"; //字体 ...

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

10. 多行输入文本组件 · LayaAir3.0文档 · LAYABOX [ 96%]

...组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.txtarea.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.txtarea.size(500, 200); //大小 this.txtarea.pivot(this.txtarea.width/2, this.txtarea.height/2); //轴心点 this.txtarea.text = "大...

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