大约有 63 项符合查询结果, 库内数据总量为 30,900 项。 (搜索耗时: 0.0030 秒)
...宽高范围内。 */ export class DrawLine extends Laya.Script { declare owner: Laya.Sprite; line2DRender: Laya.Line2DRender; lastMousePos: number[] = []; isDrawing: boolean = false; // 标记是否正在绘制 // 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法...
来源: Laya3.0_文档 发布时间: 20250214
...虎兔龙蛇马羊猴鸡狗猪年快乐"; 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
...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
...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
... } = 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
...= 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
...// img.skin = url; //ui组件直接设置skin也可以 img.pos(x, y); this.owner.addChild(img); }); } } 1.2 带类型的加载方式 有的时候,网络资源没有后缀名,又或者,图片xxx.png并非是当成Texture使用,需要被定义为TextureCube。所以,这些时候需要通过...
来源: Laya3.0_文档 发布时间: 20240910
...= 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
... //加载Base64图片数据 sp1.loadImage(e.target.result as string); this.owner.addChild(sp1); } }); 上述代码中,用 Laya.loader.fetch 加载图片二进制数据,根据自定义的规则,可以解析数据加密方式,并获得完整图片数据。在这里我们更多的介绍一下 L...
来源: Laya3.0_文档 发布时间: 20230303
...= 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