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

大约有 573 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0051 秒)

171. 显示文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 82%]

...组件均已创建完毕,此方法只执行一次 */ onAwake(): void { this.lab.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置 this.lab.size(500, 30); //大小 this.lab.pivot(this.lab.width/2, this.lab.height/2); //轴心点 this.lab.text = "大家好,欢迎大家来到...

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

172. Layabox web 复制一段文字到剪贴板 [ 82%]

...ction copyText(str) { new ShowDiv(str); }  function ShowDiv(str) {  var _this = thisthis.AppConfirm = document.getElementById("AppConfirm"); if (this.AppConfirm == null) { this.AppConfirm = document.createElement("div"); document.body.appendChild(this.AppConfirm); this.AppConfirm.id = "AppConf...

来源: Laya_社区 发布时间: 20181214

173. 陀螺仪与加速计(JavaScript-LayaAir基础篇(JS)-硬件设备相关) [ 82%]

...下面演示获取旋转方位信息: ```typescript Laya.init(550, 400); this.info = new Laya.Text(); this.info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height);  Laya.stage.addChild(this.info);  Laya.Gyroscope.instance.on(Laya.Event.CHANGE, this, o...

来源: Laya2.0_文档 发布时间: 20210714

174. UI-Label [ 82%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } setup() { this.createLabel("#FFFFFF", null).pos(30, 50); this.createLabel("#00FFFF", null).pos(290, 50); this.createLabel("#FFFF00", "#FFFFFF").pos(30, 100); this.createLabel("#000000", "#FFFFFF").pos(290, 100...

来源: Laya2.0_示例 发布时间: 20251130

175. Sprite-屏幕截图 [ 82%]

...() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; this.btnArr = ["res/threeDimen/ui/button.png", "res/threeDimen/ui/button.png", "res/threeDimen/ui/button.png"]; this.nameArr = ["canvas截图","sprite截图","清理"]; this._canvas = null; this.aimSp = null; this.drawImage =...

来源: Laya2.0_示例 发布时间: 20251130

176. 位图字体生效 [ 82%]

...apFont(); mBitmapFont.loadFont("res/bitmapFont/test.fnt", new Laya.Handler(this, onLoaded)); function onLoaded(){ mBitmapFont.setSpaceWidth(10); Laya.Text.registerBitmapFont(mFontName,mBitmapFont); let txt = new Laya.Text(); txt.text='手机号 +86'; txt.color='#FFFFFF'; txt.font = mFontName;//=====...

来源: Laya_社区 发布时间: 20191108

177. 屏幕适配-自动横屏 [ 82%]

...tage.screenMode = Stage.SCREEN_HORIZONTAL; Laya.stage.bgColor = "#232628"; this.showText(); } private showText(): void { var text: Text = new Text(); text.text = "Orientation-Landscape"; text.color = "gray"; text.font = "Impact"; text.fontSize = 50; text.x = Laya.stage.width - text.width >> 1; text....

来源: Laya_示例 发布时间: 20251130

178. 屏幕适配-自动竖屏 [ 82%]

....stage.screenMode = Stage.SCREEN_VERTICAL; Laya.stage.bgColor = "#232628"; this.showText(); } private showText(): void { var text: Text = new Text(); text.text = "Orientation-Portrait"; text.color = "gray"; text.font = "Impact"; text.fontSize = 50; text.x = Laya.stage.width - text.width >> 1; text.y...

来源: Laya_示例 发布时间: 20251130

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

...文本节点失去焦点时执行回调,发送数据 onAwake(): void { this.owner.on(Laya.Event.BLUR, this, this.sendData) } //将玩家数据上传至云端 sendData() { //组织数据 let KVDataList = []; let text = Number(this.owner.text); if(!isNaN(text) && text >= 0 && text...

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

180. sound manager在MOUSE_OVER事件中无法播放 [ 81%]

...       Laya.stage.bgColor = "#232628";              this.setup();         }          private setup(): void {             var gap: number = 10;              //创建一个Sprite充当音效播放按钮             var...

来源: Laya_社区 发布时间: 20201203