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

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

1. 字体切片组件 · LayaAir3.0文档 · LAYABOX [ 100%]

...虎兔龙蛇马羊猴鸡狗猪年快乐"; testFontClip.spaceY = 10; this.owner.addChild(clipnum); this.owner.addChild(fontClip); this.owner.addChild(testFontClip); this.owner.addChild(testClipNum); this.owner.addChild(clipnum1); } } 通常FontClip已经可以满足开发者的基本需求。如果...

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

2. 开放数据域组件 · LayaAir3.0文档 · LAYABOX [ 97%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.OpenDataContextView }) public opendata: Laya.OpenDataContextView; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此...

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

3. UI运行时 · LayaAir3.0文档 · LAYABOX [ 96%]

... RuntimeScript; onStart() { // 获得场景的Runtime对象 this.ui = this.owner.scene as RuntimeScript; // Button添加鼠标事件,让Image不显示 this.ui.Button.on( Laya.Event.MOUSE_DOWN, null, ()=>{ this.ui.Image.visible = false; }); } } ui 属性直接从脚本中通过 this.owner.scene ...

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

4. 音频节点 · LayaAir3.0文档 · LAYABOX [ 95%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.SoundNode }) public sound: Laya.SoundNode; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ ...

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

5. 事件管理 · LayaAir3.0文档 · LAYABOX [ 93%]

...如下代码: onAwake(): void { //侦听自定义的事件"Click" this.owner.on("Click",this,()=>{ console.log("侦听到自定义的“Click”事件"); }) } //鼠标点击后执行,发送Click事件。 onMouseClick(evt: Laya.Event): void { //自定义的事件 this.owner.event("Click"); } ...

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

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

...dth - bg.width >> 1, Laya.stage.height - bg.height >> 1); this.owner.addChild(bg); } private createTimerAnimation(): void { this.counter = new Laya.Clip(this.clipSkin, 10, 1); this.counter.autoPlay = true; this.counter.interval = 1000; this.counter.x = (Laya.stage.width - this.counter.wi...

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

7. 动画节点 · LayaAir3.0文档 · LAYABOX [ 86%]

...= Laya; @regClass() export class Animation extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.Animation }) //在IDE面板中显示属性 ani: Laya.Animation; constructor() { super(); } //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法...

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

8. 显示文本组件 · LayaAir3.0文档 · LAYABOX [ 79%]

...aya; @regClass() export class LabelControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake...

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

9. TiledMap地图 · LayaAir3.0文档 · LAYABOX [ 77%]

...e2D下 private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHandler(e: any = null): void { this.onLoaded(); } } 编译运行代码,效果如图3-3所示,说明地图已创建成功。 (图3-3...

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

10. 视频节点 · LayaAir3.0文档 · LAYABOX [ 76%]

...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(): void { let video = new Laya.VideoNode; //添加到舞...

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