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

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

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

.../ 游戏开始时有一个食物 this.produceFood(); } initSnake() { const Point = Laya.Point; for (let i = 0; i 0) { let prevSeg = segments[segments.length - 1]; seg.rotation = prevSeg.rotation; let point = seg.getPinPosition(); seg.x = prevSeg.x - point.x; seg.y = prevSeg.y - point.y; } segments.p...

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

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

...this.onMouseMove); } /**计算两个触摸点之间的距离*/ getDistance(points) { let distance = 0; if (points && points.length == 2) { let dx = points[0].stageX - points[1].stageX; let dy = points[0].stageY - points[1].stageY; distance = Math.sqrt(dx * dx + dy * dy); } return distance; } } new I...

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

3. 其他引擎的Demo-Example_23 [ 99%]

...rameLoop(1, this, this.animate); } animate() { const Sprite = Laya.Sprite, Point = Laya.Point; let laser; if (tick > frequency) { tick = 0; // iterate through the dudes and update the positions laser = new Sprite(); laser.loadImage("res/pixi/laser0" + ((type % 5) + 1) + ".png"); type++; laser.life =...

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

4. 其他引擎的Demo-Example_05 [ 99%]

...1; var current = 0; var objs = 17; var vx = 0; var vy = 0; var vz = 0; var points1 = []; var points2 = []; var points3 = []; var tpoint1 = []; var tpoint2 = []; var tpoint3 = []; var balls = []; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); ...

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

5. 区块地图-等角地图 [ 96%]

... createMap() { const TiledMap = Laya.TiledMap, Rectangle = Laya.Rectangle, Point = Laya.Point; this.tiledMap = new TiledMap(); this.tiledMap.createMap("res/tiledMap/isometric_grass_and_water.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), Laya.Handler.create(this, this.mapLoaded), n...

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

6. 输入设备-地图 [ 96%]

...oZoom(); // 初始地点北京,缩放系数15 map.centerAndZoom(new BMap.Point(116.32715863448607, 39.990912172420714), 15); // 创建标注物 marker = new BMap.Marker(new BMap.Point(0,0)); map.addOverlay(marker); let label = new BMap.Label("当前位置", { offset: new BMap.Size(-15, 30) }); mar...

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

7. 2D物理-桥 [ 95%]

...let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,600,1050,600"; let point1 = new Laya.Sprite(); Laya.Laya.stage.addChild(point1); point1.pos(startPosX, startPosY); let pointRB1 = new Laya.RigidBody(); pointRB1.type = "static"; point1.addComponentIntance(pointRB...

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

8. 2D物理-仿生机器人 [ 84%]

...let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,200,50,570,1050,570,1050,200"; for (let i = 1; i 0) { legCollider1.points = p1.concat(p2).concat(p3).join(","); legCollider2.points = [0, 0].concat(B2Math.SubVV(p5, p4)).concat(B2Math.SubVV(p6, p4)).join(","); } ...

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

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

...let chainCollider = 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; sensorColli...

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

10. UI-RefreshList [ 51%]

...a.WebGL; Animation = Laya.Animation; Label = Laya.Label; Text = Laya.Text; Point = Laya.Point; Tween = Laya.Tween; TextArea = Laya.TextArea; class UI_RefreshList { constructor() { this.baseBox = null; this.refreshLoading = null; this.loadingAni = null; this.loadingLabel = null; this.refreshList = nu...

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