大约有 25 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0032 秒)
... laser.life = 0; let pos1; let pos2; if (type % 2) { pos1 = new Point(-20, Math.random() * viewHeight); pos2 = new Point(viewWidth, Math.random() * viewHeight + 20); } else { pos1 = new Point(Math.random() * viewWidth, -20); pos2 = new Point(Math.random() * viewWidth, viewHeight + 20); } let distX =...
来源: Laya2.0_示例 发布时间: 20241117
...ext = new Text(); textBox.addChild(text); text.fontSize = 20; text.text = (Math.random() * 100).toFixed(0); text.rotation = Math.random() * 360; text.color = "#ccc"; text.x = Math.random() * Laya.stage.width; text.y = Math.random() * Laya.stage.height; } //缓存为静态图像 textBox.cacheAs = "bi...
来源: Laya2.0_示例 发布时间: 20241117
...] - 1; } x3d = tpoint1[i]; y3d = tpoint2[i]; z3d = tpoint3[i]; ty = (y3d * Math.cos(vx)) - (z3d * Math.sin(vx)); tz = (y3d * Math.sin(vx)) + (z3d * Math.cos(vx)); tx = (x3d * Math.cos(vy)) - (tz * Math.sin(vy)); tz = (x3d * Math.sin(vy)) + (tz * Math.cos(vy)); ox = tx; tx = (tx * Math.cos(vz)) - (ty...
来源: Laya2.0_示例 发布时间: 20241117
...通过地图坐标得到屏幕坐标 this.layer.getScreenPositionByTilePos(Math.floor(p.x), Math.floor(p.y), p); this.sprite.pos(p.x, p.y); } mapLoaded() { this.layer = this.tiledMap.getLayerByIndex(0); var radiusX = 32; var radiusY = Math.tan(180 / Math.PI * 30) * radiusX; // 14.37 var color = "#FF...
来源: Laya2.0_示例 发布时间: 20241117
...ze); 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 { constructor(width, height) { super(); this.size(width, height); this.init(); } init() { this.graphics.drawR...
来源: Laya2.0_示例 发布时间: 20241117
...Ape() { const Sprite = Laya.Sprite; const layoutRadius = 150, radianUnit = Math.PI / 2; // 该容器用于装载4张猩猩图片 this.apesCon = new Sprite(); Laya.stage.addChild(this.apesCon); // 添加4张猩猩图片 let ape; for (let i = 0; i < 4; i++) { ape = new Sprite(); this.apesCon.addChild(...
来源: Laya2.0_示例 发布时间: 20241117
...frameLoop(1, this, this.renderBg); } createPhoenixes() { let scaleFactor = Math.min( Laya.stage.width / (phoenixWidth * 2), Laya.stage.height / phoenixHeight); // 混合模式的凤凰 let blendedPhoenix = this.createAnimation(); blendedPhoenix.blendMode = Laya.BlendMode.LIGHTER; // 指定要使用...
来源: Laya2.0_示例 发布时间: 20241117
... p1.concat(p2).concat(p3).join(","); legCollider2.points = [0, 0].concat(B2Math.SubVV(p5, p4)).concat(B2Math.SubVV(p6, p4)).join(","); } else { legCollider1.points = p1.concat(p3).concat(p2).join(","); legCollider2.points = [0, 0].concat(B2Math.SubVV(p6, p4)).concat(B2Math.SubVV(p5, p4)).join(","); ...
来源: Laya2.0_示例 发布时间: 20241117
...let touches = e.touches; if (touches && touches.length == 2) { preRadian = Math.atan2( touches[0].stageY - touches[1].stageY, touches[0].stageX - touches[1].stageX); Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove); } } onMouseMove(e) { let touches = e.touches; if (touches && touches.length =...
来源: Laya2.0_示例 发布时间: 20241117
...并非正确方位。"); } // 更新角度显示 degreesText.text = 360 - Math.floor(info.alpha) + "°"; compassImg.rotation = info.alpha; // 更新方位指示器 directionIndicator.x = -1 * Math.floor(info.gamma) / 90 * 70 + compassImg.x; directionIndicator.y = -1 * Math.floor(info.beta) / 90 * 70...
来源: Laya2.0_示例 发布时间: 20241117