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

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

1. 2D线渲染器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...宽高范围内。 */ export class DrawLine extends Laya.Script { declare owner: Laya.Sprite; line2DRender: Laya.Line2DRender; lastMousePos: number[] = []; isDrawing: boolean = false; // 标记是否正在绘制 // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法...

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

2. 字体切片组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 95%]

...虎兔龙蛇马羊猴鸡狗猪年快乐"; 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_文档 发布时间: 20240910

3. 绘制图形 · LayaAir3.3 · 引擎文档 · LAYABOX [ 93%]

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

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

4. 位图切片组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...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_文档 发布时间: 20240910

5. 2D方向光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 88%]

... } = Laya; @regClass() export class DayNight extends Laya.Script { declare owner: Laya.Sprite; private lightComp: Laya.DirectionLight2D; private dayTime: number = 0; private dayDuration: number = 24; // 一个完整周期的秒数 private displayText: Laya.Text; // 文本显示当前时间 onAwake()...

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

6. 开放数据域组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 85%]

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

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

7. 资源加载 · LayaAir3.3 · 引擎文档 · LAYABOX [ 83%]

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

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

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

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

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

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

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

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

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

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

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