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

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

1. 区块地图-等角地图 [ 100%]

...r 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, radiusY * 2, color); this.sprite.graphics.drawLine(radiusX, radiusY, ...

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

2. 输入设备-指南针 [ 98%]

...ator.graphics.drawCircle(0, 0, 70, "#343434"); directionIndicator.graphics.drawLine(-40, 0, 40, 0, "#FFFFFF", 3); directionIndicator.graphics.drawLine(0, -40, 0, 40, "#FFFFFF", 3); directionIndicator.x = compassImg.x; directionIndicator.y = compassImg.y; } drawUI() { const Sprite = Laya.Sprite; let ...

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

3. Sprite-绘制各种形状 [ 91%]

... let sp = new Laya.Sprite(); Laya.stage.addChild(sp); //画线 sp.graphics.drawLine(10, 58, 146, 58, "#ff0000", 3); //画连续直线 sp.graphics.drawLines(176, 58, [0, 0, 39, -50, 78, 0, 117, 50, 156, 0], "#ff0000", 5); //画曲线 sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58, 100, 78...

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

4. 缓动-简单的Tween [ 79%]

...2.png"); characterB.pivot(34, 50); characterB.y = 250; Laya.stage.graphics.drawLine(terminalX, 0, terminalX, Laya.stage.height, "#FFFFFF"); // characterA使用Tween.to缓动 Tween.to(characterA, { x : terminalX }, 1000); // characterB使用Tween.from缓动 characterB.x = terminalX; Tween.from(charac...

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

5. 鼠标交互-滑动 [ 66%]

...osition = beginPosition + TrackLength; } drawTrack() { Laya.stage.graphics.drawLine( beginPosition, Laya.stage.height / 2, endPosition, Laya.stage.height / 2, "#FFFFFF", 20); } /**按下事件处理*/ onMouseDown(e) { const Event = Laya.Event; //添加鼠标移到侦听 Laya.stage.on(Event.MOUSE_MOV...

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