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

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

1. UI-Clip [ 100%]

...n); bg.size(224, 302); bg.pos(Laya.stage.width - bg.width >> 1, Laya.stage.height - bg.height >> 1); Laya.stage.addChild(bg); } function createTimerAnimation() { counter = new Clip(clipSkin, 10, 1); counter.autoPlay = true; counter.interval = 1000; counter.x = (Laya.stage.width - counter.width) / 2 ...

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

2. 文本-字数限制 [ 99%]

...WebGL时自动切换至Canvas 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"; createInput(); })(); function createInput() { var inp...

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

3. 输入设备-摇一摇 [ 99%]

...84; var console; var shakeCount = 0; (function() { Laya.init(picW, Browser.height * picW / Browser.width); Laya.stage.scaleMode = Stage.SCALE_SHOWALL; showShakePic(); showConsoleText(); startShake(); })(); function showShakePic() { var shakePic = new Sprite(); shakePic.loadImage("../../res/inputDevi...

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

4. 屏幕适配-缩放-No Scale [ 99%]

...ction updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_NOSCALE { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NO...

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

5. UI-Dialog [ 98%]

...= Laya.Handler; var WebGL = Laya.WebGL; var DIALOG_WIDTH = 220; var DIALOG_HEIGHT = 275; var CLOSE_BTN_WIDTH = 43; var CLOSE_BTN_PADDING = 5; var assets; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = St...

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

6. 屏幕适配-缩放-No Border [ 97%]

...ction updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_NOBORDER { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_N...

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

7. 屏幕适配-缩放-Show All [ 97%]

...ction updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_SHOW_ALL { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_S...

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

8. 屏幕适配-缩放-Extract Fit [ 97%]

...ction updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_EXTRACT_FIT { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCAL...

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

9. UI-Button [ 96%]

...ar WebGL = Laya.WebGL; var COLUMNS = 2; var BUTTON_WIDTH = 147; var BUTTON_HEIGHT = 165 / 3; var HORIZONTAL_SPACING = 200; var VERTICAL_SPACING = 100; var xOffset; var yOffset; var skins; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.AL...

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

10. DOM元素-表单输入 [ 95%]

...,120); this.form.pos((Laya.stage.width - this.form.width) / 2, (Laya.stage.height - this.form.height) / 2); Laya.stage.addChild(this.form); this.rowHeight = 30; this.rowSpacing = 10; var rowHeightDelta = this.rowSpacing + this.rowHeight; // 显示左侧标签 showLabel("邮箱", 0, rowHeightDelta * ...

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