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

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

1. IDE-显示IDE创建的界面 [ 100%]

...发更高效。var Loader = Laya.Loader; var Handler = Laya.Handler; var Event = Laya.Event; // 创建TestPageUI的子类 function TestUI() { TestUI.super(this); //btn是编辑器界面设定的,代码里面能直接使用,并且有代码提示 this.btn.on(Event.CLICK, this, onBtnClick); this.bt...

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

2. 2D物理-桥 [ 98%]

...FIXED_AUTO; Laya.Laya.stage.bgColor = "#232628"; this.createBridge(); this.eventListener(); } createBridge() { const startPosX = 250, startPosY = 450; let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addCompon...

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

3. 2D物理-复合碰撞器 [ 98%]

...LE_FIXED_AUTO; Laya.Laya.stage.bgColor = "#232628"; this.createBox(); this.eventListener(); } createBox() { const width = 300, height = 20; const posx = Laya.Browser.width / 2, posy = Laya.Browser.height / 2; let box = this.box = new Laya.Sprite(); box.size(width + height * 2, width + height * 2); b...

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

4. 缓动-时间线 [ 97%]

...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; this.createApe(); this.createTimerLine(); Laya.stage.on(Event.KEY_DOWN, this, this.keyDown); } createApe() { const Sprite = Laya.Sprite; this.target = new Sprite(); Laya.stage.addChild(this.target); this.t...

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

5. 缓动-缓动函数演示 [ 97%]

... duration, Ease[list.selectedItem]); } createDurationCrontroller() { const Event = Laya.Event; let durationInput = this.createInputWidthLabel("Duration:", '2000', 400, 10); durationInput.on(Event.INPUT, this, function() { duration = parseInt(durationInput.text); }); } createInputWidthLabel(label, pr...

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

6. 2D物理-仿生机器人 [ 95%]

...LE_FIXED_AUTO; Laya.Laya.stage.bgColor = "#232628"; this.Construct(); this.eventListener(); } Construct() { let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let rigidbody = new Laya.RigidBody(); rigidbody.type = "static"; ground.addComponentIntance(rigidbody); let chainCollider = gr...

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

7. 计时器-延迟执行 [ 92%]

...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; let vGap = 100; this.button1 = this.createButton("点我3秒之后 alpha - 0.5"); this.button1.x = (Laya.stage.width - this.button1.width) / 2; this.button1.y = (Laya.stage.height - this.button1.height - v...

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

8. 音频-播放演示 [ 88%]

...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; var gap = 10; //创建一个Sprite充当音效播放按钮 let soundButton = this.createButton("播放音效"); soundButton.x = (Laya.stage.width - soundButton.width * 2 + gap) / 2; soundButton.y = (Laya.s...

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

9. DOM元素-表单输入 [ 85%]

...ayInput.type = "date"; passwordInput.type = "password"; Laya.stage.on(Laya.Event.RESIZE, this, this.fitDOMElements, [emailInput, birthdayInput, passwordInput]); } showLabel(label, x, y) { const Text = Laya.Text; let t = new Laya.Text(); t.height = this.rowHeight; t.valign = "middle"; t.fontSize = 15...

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

10. 骨骼动画-Spine事件 [ 83%]

...tX = 400, mStartY = 500, mCurrIndex = 0, mLabelSprite; class Skeleton_SpineEvent { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Sprite = Laya.Sprite; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeig...

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