大约有 191 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0039 秒)
Laya_社区(66) Laya2.0_示例(38) Laya_示例(33) Laya2.0_文档(25) Laya3.0_api(13) Laya3.0_文档(6) laya_api(5) Laya2.0_api(5)
...宽高 txt.width = 400; txt.height = 400; //设置文本水平居中 txt.align = "center"; //设置文本垂直居中 txt.valign = "middle"; Laya.stage.addChild(txt); } } } ``` ![5](img/5.png) 在实际编码中如果需要其他的对齐模式,请参考API中的align和valign的取值,找到适...
来源: Laya2.0_文档 发布时间: 20210715
文本align="center", 对齐方式无效,无论设置什么值,都是左对齐 var txtCountDown = new Laya.Text(); txtCountDown.fontSize = 30; this.rankSprite2.txtCountDown = txtCountDown; this.rankSprite2.addChild(txtCountDown); txtCountDown.text = 15; txtCountDown.pivotX = txtCountDown.width/...
来源: Laya_社区 发布时间: 20180514
...支持WebGL时自动切换至Canvas Laya.init(600, 300, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createTexts(); } private createTexts(): void { var t1: Text = this.createTe...
来源: Laya2.0_文档 发布时间: 20210715
...支持WebGL时自动切换至Canvas Laya.init(600, 300, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; createTexts(); })(); function createTexts() { var t1 = createText(); t1.overflow...
来源: Laya2.0_文档 发布时间: 20210714
...xHeight(); }; var startY = padding[0]; if (this._height > 0) { var tempVAlign = (this._textHeight > this._height) ? "top" : this.valign; if (tempVAlign === "middle") startY = (this._height - visibleLineCount * lineHeight) * 0.5 + padding[0] - padding[2]; else if (tempVAlign === "bottom") start...
来源: Laya_社区 发布时间: 20180417
...eHeight = 30; text.style.color = color; text.style.width = 500; text.style.align = "center"; text.style.weight = "bold"; text.innerHTML = "中华人民共和国"; text.filters = [new GlowFilter("#000", 4, 2, 2)]; text.x = (ClientConfig.displayWidth-text.width)/2; text.y = (ClientConfig.displayHeight...
来源: Laya_社区 发布时间: 20170216
...as Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; setup(); })(); function setup() { createInteractiveTarget(); createLogger(); } function cr...
来源: Laya_示例 发布时间: 20241117
...ght - console.y; console.color = "#FFFFFF"; console.fontSize = 50; console.align = "center"; console.valign = 'middle'; console.leading = 10; } function startShake() { Shake.instance.start(5, 500); Shake.instance.on(Laya.Event.CHANGE, this, onShake); console.text = '开始接收设备摇动\n'; } fu...
来源: Laya_示例 发布时间: 20241117
...fs>'; if (this.isShadow) { // alignment data += this.getTextAlignment(); data += 'font-size="' + this.fontSize; data += '" filter= "url(%23shadow)" fill="black"' ...
来源: Laya_社区 发布时间: 20180824
...as Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createInteractiveTarget(); this.crea...
来源: Laya2.0_示例 发布时间: 20241117