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

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

1. Sprite-根据数据绘制路径 [ 100%]

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

2. 文本-下划线 [ 97%]

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

3. 区块地图-等角地图 [ 89%]

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

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

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

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

...e(); Laya.stage.addChild(this.sp); this.sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.sp.size(w, h); this.sp.pivot(w / 2, h / 2); this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event = Laya.Event; // 手机...

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

6. 鼠标交互-双指缩放(多点触控) [ 85%]

...e(); Laya.stage.addChild(this.sp); this.sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.sp.size(w, h); this.sp.pivot(w / 2, h / 2); this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event = Laya.Event; // 手机...

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

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

...ite(); Laya.stage.addChild(button); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.size(w, h); button.graphics.fillText(label, w / 2, 17, "20px simHei", "#ffffff", "center"); return button; } onDecreaseAlpha1(e) { const Event = Laya.Event; //移除鼠标单击事件 this.button1.off(Event.C...

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

8. 鼠标交互-修正交互区域 [ 83%]

...ralRect.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height / 2, "#FF7F50"); //设置名称 coralRect.name = "珊瑚色容器"; coralRect.size(Laya.stage.width, Laya.stage.height / 2); Laya.stage.addChild(coralRect); coralRect.on(Event.MOUSE_DOWN, this, this.onDown); } createDeepSkyblueRect(...

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

9. 鼠标交互-滑动 [ 81%]

...0; this.button = new Sprite(); this.button.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.button.pivot(w / 2, h / 2); //设置宽高(要接收鼠标事件必须设置宽高,否则不会被命中) this.button.size(w, h); this.button.x = (Laya.stage.width - TrackLength) / 2; this.button.y = Laya...

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

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

...his.height / 2, -this.height / 2, this.width + this.height, this.height, "#FF7F50"); } // 获取关节另一头位置 getPinPosition() { const Point = Laya.Point; let radian = this.rotation * Math.PI / 180; let tx = this.x + Math.cos(radian) * this.width; let ty = this.y + Math.sin(radian) * this.wi...

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