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

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

1. 输入设备-指南针 [ 100%]

...mg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } createDirectionIndicator() { const Sprite = Laya.Sprite; directionIndicator = new Sprite(); Laya.stage.addChild(directionIndicator); directionIndicator.alpha = 0.8; directionIndicator.graphics.drawCircle(0, 0, 70, "#3...

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

2. UI-Tab [ 95%]

...r = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, 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(); Laya.loader.load(skins, Handler.create(this...

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

3. UI-Input [ 89%]

...nput = new TextInput(); ti.skin = skin; ti.size(300, 50); ti.sizeGrid = "0,40,0,40"; ti.font = "Arial"; ti.fontSize = 30; ti.bold = true; ti.color = "#606368"; Laya.stage.addChild(ti); return ti; } } } new laya.UI_Input();package { import laya.display.Stage; import laya.ui.TextInput; import laya.uti...

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

4. 文本-自动换行 [ 85%]

...发者提供HTML5开发技术方案!"; txt.width = 300; txt.fontSize = 40; txt.color = "#ffffff"; // 设置文本是否自动换行 txt.wordWrap = true; txt.x = Laya.stage.width - txt.textWidth >> 1; txt.y = Laya.stage.height - txt.textHeight >> 1; } } new Text_Scroll();module laya { import Stage ...

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

5. 文本-复杂的文本样式 [ 82%]

...ML5开发技术方案!"; //设置宽度,高度自动匹配 txt.width = 400; //自动换行 txt.wordWrap = true; txt.align = "center"; txt.fontSize = 40; txt.font = "Microsoft YaHei"; txt.color = "#ff0000"; txt.bold = true; txt.leading = 5; //设置描边属性 txt.stroke = 2; txt.strokeColor = "...

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

6. 其他引擎的Demo-Example_23 [ 77%]

...Y = pos1.y - pos2.y; let dist = Math.sqrt(distX * distX + distY * distY) + 40; laser.scaleX = dist / 20; laser.pos(pos1.x, pos1.y); laser.pivotY = 43 / 2; laser.blendMode = "lighter"; laser.rotation = (Math.atan2(distY, distX) + Math.PI) * 180 / Math.PI; lasers.push(laser); Laya.stage.addChild(laser...

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

7. 音频-播放演示 [ 76%]

...ICK, this, this.onPlayMusic); } createButton(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"); r...

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

8. UI-Clip [ 72%]

.../ 2 - 35; this.counter.y = (Laya.stage.height - this.counter.height) / 2 - 40; } showTotalSeconds() { const Clip = Laya.Clip; let clip = new Clip(clipSkin, 10, 1); clip.index = clip.clipX - 1; clip.pos(this.counter.x + 60, this.counter.y); Laya.stage.addChild(clip); } createController() { const Butt...

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

9. 输入设备-贪吃蛇(重力感应) [ 67%]

...ew Sprite(); Laya.stage.addChild(food); foods.push(food); const foodSize = 40; food.size(foodSize, foodSize); food.graphics.drawRect(0, 0, foodSize, foodSize, "#00BFFF"); food.x = Math.random() * Laya.stage.width; food.y = Math.random() * Laya.stage.height; } } class Segment extends Laya.Sprite { co...

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

10. 2D物理-碰撞事件与传感器 [ 60%]

...ider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,400,50,600,1050,600,1050,400"; let sensorCollider = this.sensorCollider = ground.addComponent(Laya.CircleCollider); sensorCollider.isSensor = true; sensorCollider.radius = 100; sensorCollider.x = 450; sensorCollider.y = 300; ...

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