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

大约有 52 项符合查询结果, 库内数据总量为 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%]

...p.graphics.drawRect(20, 20, 100, 50, "#ffff00", "#00ff00", 5, false); this.owner.addChild(sp); 示例中的 20,20 是矩形起始点坐标,100是向右的宽度,如果是负数则是向左的宽度。50是向下的高度,如果是负数则是向上的高度。 运行效果: (图2-3) 2....

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

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

...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

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

...= 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

5. 资源加载 · LayaAir3.0文档 · LAYABOX [ 87%]

...// img.skin = url; //ui组件直接设置skin也可以 img.pos(x, y); this.owner.addChild(img); }); } } 1.2 带类型的加载方式 有的时候,网络资源没有后缀名,又或者,图片xxx.png并非是当成Texture使用,需要被定义为TextureCube。所以,这些时候需要通过...

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

6. 音频节点 · LayaAir3.0文档 · LAYABOX [ 87%]

...= 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

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

... //加载Base64图片数据 sp1.loadImage(e.target.result as string); this.owner.addChild(sp1); } }); 上述代码中,用 Laya.loader.fetch 加载图片二进制数据,根据自定义的规则,可以解析数据加密方式,并获得完整图片数据。在这里我们更多的介绍一下 L...

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

8. 动画节点 · LayaAir3.0文档 · LAYABOX [ 82%]

...= 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

9. 组件属性的代码使用 · LayaAir3.0文档 · LAYABOX [ 80%]

...nderer: Laya.ShurikenParticleRenderer; onAwake(): void { (this.p3dRenderer.owner as Laya.Sprite3D).transform.localPosition = new Laya.Vector3(0,5,5); this.p3dRenderer.particleSystem.simulationSpeed = 10; } 通过暴露@property( { type : Laya.ShurikenParticleRenderer } )组件类型属性,来拖...

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

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

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

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