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

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

1. 音频节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...prite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.sound.source = "resources/sound.wav"; //音频路径 this.sound.lo...

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

2. 列表组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

...cript extends Laya.Script { @property({ type: Laya.List }) list: Laya.List constructor() { super(); } // 组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { // 给List对象赋值 var data: Array<any> = []; for (var m: number = 0; m < 20; m++) { data.push({ m_lab...

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

3. 3D变换 · LayaAir3.3 · 引擎文档 · LAYABOX [ 88%]

... 平移距离 private translate: Laya.Vector3 = new Laya.Vector3(1, 1, 1); constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { // 平移cube this.cube.transform.translate(this.translate, false); } }...

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

4. 对象池 · LayaAir3.3 · 引擎文档 · LAYABOX [ 82%]

...f (instance) { var className: string = instance["__className"] || instance.constructor._$gid; if (className) Pool.recover(className, instance); } } 有了这两种对应的方式,我们可以不用在代码中去关心每个对象的创建和回收,只关心对象的内部逻辑就好了。比...

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

5. 陀螺仪与加速计 · LayaAir3.3 · 引擎文档 · LAYABOX [ 81%]

...取旋转方位信息: class Gyroscope_Sample { private info: Laya.Text; constructor() { Laya.init(550, 400); this.info = new Laya.Text(); this.info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height); Laya.stage.addChild(this.info); Laya.Gyroscope.insta...

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

6. 显示文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 80%]

... Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.lab.pos(Laya.stage.width >> 1, Laya.stage.height >> 1)...

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

7. 进度条组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 77%]

...I_ProgressBar extends Laya.Script { private progressBar: Laya.ProgressBar; constructor() { super(); } onAwake(): void { // 加载进度条资源,图片资源来自“引擎API使用示例” Laya.loader.load(["resources/res/ui/progressBar.png", "resources/res/ui/progressBar$bar.png"]).then(() =&gt...

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

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

...roperty } = Laya; @regClass() export class NewScript extends Laya.Script { constructor() { super(); } onMouseClick(evt: Laya.Event): void { // 尝试获取当前位置 Laya.Geolocation.getCurrentPosition( Laya.Handler.create(this, this.onSuccess), Laya.Handler.create(this, this.onError) ); console.l...

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

9. UI弹窗 · LayaAir3.0文档 · LAYABOX [ 76%]

...N_PADDING: number = 5; private assets: any[]; private dialog: Laya.Dialog; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.assets = ["resources/res/ui/dialog (1).png", "resources/res/ui/clo...

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

10. 动画节点 · LayaAir3.3 · 引擎文档 · LAYABOX [ 76%]

...type: Laya.Animation }) //在IDE面板中显示属性 ani: Laya.Animation; constructor() { super(); } //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.ani.source = "resources/role.atlas"; //接收动画数据源为图集 thi...

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