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

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

1. 加载-销毁Texture使用的图片资源 [ 100%]

...iFly.pos(250, 100); Laya.stage.addChild(this.aniFly); // 创建按钮 this.btn = new Sprite().size(205, 55); this.btn.graphics.drawRect(0, 0, this.btn.width, this.btn.height, "#057AFB"); this.txt = new Text(); this.txt.text = "销毁"; this.txt.pos(75, 15); this.txt.fontSize = 25; this.txt.color = "...

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

2. Sprite-屏幕截图 [ 99%]

...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 = null...

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

3. UI-Dialog [ 97%]

...项目开发更高效。let DIALOG_WIDTH = 220, DIALOG_HEIGHT = 275, CLOSE_BTN_WIDTH = 43, CLOSE_BTN_PADDING = 5, assets = ["res/ui/dialog (1).png", "res/ui/close.png"]; class UI_Dialog { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler ...

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

4. UI-Button [ 93%]

...oid { for (var i: number = 0, len = this.skins.length; i < len; ++i) { var btn: Button = this.createButton(this.skins[i]); var x: number = i % this.COLUMNS * this.HORIZONTAL_SPACING + this.xOffset; var y: number = (i / this.COLUMNS | 0) * this.VERTICAL_SPACING + this.yOffset; btn.pos(x, y); } } priv...

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

5. IDE-显示IDE创建的界面 [ 91%]

...nt; // 创建TestPageUI的子类 function TestUI() { TestUI.super(this); //btn是编辑器界面设定的,代码里面能直接使用,并且有代码提示 this.btn.on(Event.CLICK, this, onBtnClick); this.btn2.on(Event.CLICK, this, onBtn2Click); function onBtnClick() { //手动控制组件属性...

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

6. 音频-播放演示 [ 90%]

...teButton(labelText) { let w = 110, h = 40; const Sprite = Laya.Sprite; let btn = new Sprite(); Laya.stage.addChild(btn); btn.size(w, h); btn.graphics.drawRect(0, 0, w, h, "#FF7F50"); btn.graphics.fillText(labelText, w / 2, 8, "24px SimHei", "#FFFFFF", "center"); return btn; } // 播放音效 onPlayS...

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