大约有 372 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0084 秒)
Laya_社区(116) Laya2.0_文档(64) Laya3.0_api(61) Laya2.0_api(57) laya_api(53) Laya3.0_文档(20) Laya2.0_示例(1)
...label.stroke = STROKE_WIDTH; label.strokeColor = strokeColor; } this.owner.addChild(label); return label; } } 效果预览: (图2-1) Copyright ©Layabox 2025 all right reserved,powered by LayaAir Engine更新时间: 2025-10-10 16:27:59 img{cursor:pointer}
来源: Laya3.0_文档 发布时间: 20251010
...png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); this.addChild(this.bg); //因为上面的图片是截取的 所以右边可能没有图片了 这里补一个 this.rightBg = new laya.display.Sprite(); this.rightBg.graphics.drawTexture(laya.resource.Texture.createFromTexture(this...
来源: Laya_社区 发布时间: 20160801
...行一次 */ onAwake(): void { let sprite = new Laya.Sprite(); Laya.stage.addChild(sprite); sprite.graphics.fillText("fillText:引擎绘制的文本,适合简单的单行文本", 100, 300, " 60px simHei ", "#ff0000", "left"); } 在Text与Label中,font仅仅是指系统字体,例如该文本是...
来源: Laya3.0_文档 发布时间: 20251010
...l, true, true, null, 80/56, 80/56); let t2 = new Laya.Sprite(); Laya.stage.addChild(t2); let Texture = Laya.Texture.create(t, 0, 0, t.width, t.height); t2.graphics.drawImage(Texture, 0, 0, 56, 56); } 2025-09-23 0 0 分享 微博 QZONE 微信 LayaAir大为 赞同来自: 肖亮亮 您好,我们已...
来源: Laya_社区 发布时间: 20250827
...('scene/Game.ls', Laya.Handler.create(null, function (res:any){ Laya.stage.addChild(res); })); //用Laya.loader的方式加载,加载后根节点是Scene2D Laya.loader.load('scene/Game.ls', Laya.Handler.create(this, this.onLoaded), Laya.Handler.create(this, this.onLoading)).then( (res)=>{ let s...
来源: Laya3.0_文档 发布时间: 20251010
...代码如下: ```typescript this.text.text="原text文本"; Laya.stage.addChild(this.text); //不优化的写法是:this.text.text="替换的text文本"; this.text.changeText("替换的text文本"); ``` #### 2、尽可能使用对应的文本组件 每个不同的组件都是有自己独特的...
来源: Laya2.0_文档 发布时间: 20210715
...,把加载回调中返回的完整场景scene添加到舞台 Laya.stage.addChild(scene); //获取摄像机 var camera = scene.getChildByName("Main Camera"); /** ** 省略其它代码若干,可前往Layabox官网示例或相关文档中查看 */ })); ``` ##### 5.2.2 预设的加载与使用(.lh) ...
来源: Laya2.0_文档 发布时间: 20210714
... new Laya.Sprite(); a.graphics.drawCircle(0, 0, 50, "#ff0000"); Laya.stage.addChild(a); a.size(100, 100); a.pos(200, 200); a.mouseEnabled = true; a.mouseThrough = true; a.on(Laya.Event.MOUSE_DOWN, null, function (e: Laya.Event): void { console.log("touch a"); } 因为需要将mouseThrough=true...
来源: Laya_社区 发布时间: 20161109
...); this.spe.pos(300, 350); this.spe.setProgress(this.progress); Laya.stage.addChild(this.spe); ----------------------源码-------------------------- import Shader = laya.webgl.shader.Shader; export class coolDownShader extends Shader { /** * 当前着色器的一个...
来源: Laya_社区 发布时间: 20170606
...; // 设置图片居中显示 // 将图片添加到舞台显示 Laya.stage.addChild(img); } else { console.log("收到数据:", message); } } private onConnectError(): void { console.log("Connection Error"); } } 运行效果如图3-1所示。 (图3-1) 3.3 基于Laya.Byte二进制通信 3.3.1 TypedAr...
来源: Laya3.0_文档 发布时间: 20251010