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

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

1. sprite做的按钮点击无反应? [ 100%]

...btn.graphics.drawRect((stageWd - w) * 0.5, (stageHt - h) * 0.5-50, w, h, "#FF7F50"); btn.graphics.fillText("确 定", (stageWd) * 0.5 , (stageHt - h) * 0.5-43, "25px SimHei", "#FFFFFF", "center"); //dialog_mc.addChild(btn); Laya.stage.addChild(btn); btn.on(Event.CLICK, this, function(){ alert("点...

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

2. Sprite-根据数据绘制路径 [ 95%]

...vas.graphics.drawPoly(Laya.stage.width / 2, Laya.stage.height / 2, path, "#FF7F50"); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_DrawPath { constructor() { // 不支持WebGL时自动切换...

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

3. Sprite-根据数据绘制路径 [ 95%]

...vas.graphics.drawPoly(Laya.stage.width / 2, Laya.stage.height / 2, path, "#FF7F50"); } } new Sprite_DrawPath();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_DrawPath { constructor() { // 不支持We...

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

4. 文本-下划线 [ 93%]

...0); createText('center', 2, "#00BFFF", 155, 150); createText('right', 3, "#FF7F50", 210, 290); } function createText(align, underlineWidth, underlineColor, x, y) { var txt = new Text(); txt.text = "Layabox\n是HTML5引擎技术提供商\n与优秀的游戏发行商\n面向AS/JS/TS开发者提供HTML...

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

5. 文本-下划线 [ 92%]

...this.createText('center', "#00BFFF", 155, 150); this.createText('right', "#FF7F50", 210, 290); } createText(align, underlineColor, x, y) { const Text = Laya.Text; let txt = new Text(); Laya.stage.addChild(txt); txt.text = "Layabox\n是HTML5引擎技术提供商\n与优秀的游戏发行商\n面向AS...

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

6. 区块地图-等角地图 [ 86%]

... = 32; var radiusY = Math.tan(180 / Math.PI * 30) * radiusX; var color = "#FF7F50"; sprite = new Sprite(); sprite.graphics.drawLine(0, 0, -radiusX, radiusY, color); sprite.graphics.drawLine(0, 0, radiusX, radiusY, color); sprite.graphics.drawLine(-radiusX, radiusY, 0, radiusY * 2, color); sprite.gra...

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

7. 区块地图-等角地图 [ 85%]

...r radiusY = Math.tan(180 / Math.PI * 30) * radiusX; // 14.37 var color = "#FF7F50"; this.sprite = new Laya.Sprite(); this.sprite.graphics.drawLine(0, 0, -radiusX, radiusY, color); this.sprite.graphics.drawLine(0, 0, radiusX, radiusY, color); this.sprite.graphics.drawLine(-radiusX, radiusY, 0, radius...

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

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

...a.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; } // 播放音效 onPlaySound() { console.log("播放音效"); Laya.SoundManager.playSound("res/sounds/btn.mp3", 1, new Lay...

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

9. 音频-播放演示 [ 84%]

... = new Sprite(); button.size(w, h); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.graphics.fillText(label, w / 2, 8, "25px SimHei", "#FFFFFF", "center"); Laya.stage.addChild(button); return button; } function onPlayMusic(e) { console.log("播放音乐"); SoundManager.playMusic("../../res/s...

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

10. 鼠标交互-双指旋转(多点触控) [ 84%]

...p = new Sprite(); var w = 200, h = 300; sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); sp.size(w, h); sp.pivot(w / 2, h / 2); sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.stage.addChild(sp); sp.on(Event.MOUSE_DOWN, this, onMouseDown); } function onMouseDown(e) { var touches = e.touches; i...

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