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

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

1. 其他引擎的Demo-Example_23 [ 100%]

... laser.life = 0; var pos1; var 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); } var distX =...

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

2. Sprite-缓存为静态图像 [ 97%]

... = 0; i < 1000; i++) { text = new Text(); text.fontSize = 20; text.text = (Math.random() * 100).toFixed(0); text.rotation = Math.random() * 360; text.color = "#CCCCCC"; text.x = Math.random() * Laya.stage.width; text.y = Math.random() * Laya.stage.height; textBox.addChild(text); } //缓存为静态...

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

3. 其他引擎的Demo-Example_05 [ 95%]

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

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

4. 区块地图-等角地图 [ 95%]

...Laya.stage.mouseX, Laya.stage.mouseY, p); layer.getScreenPositionByTilePos(Math.floor(p.x), Math.floor(p.y), p); sprite.pos(p.x, p.y); } function mapLoaded() { layer = tiledMap.getLayerByIndex(0); var radiusX = 32; var radiusY = Math.tan(180 / Math.PI * 30) * radiusX; var color = "#FF7F50"; sprite =...

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

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

...gment.prototype.getPinPosition = function() { var radian = this.rotation * Math.PI / 180; var tx = this.x + Math.cos(radian) * this.width; var ty = this.y + Math.sin(radian) * this.width; return new Point(tx, ty); } this.size(width, height); this.init(); } Laya.class(Segment, "Segment", Sprite); var...

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

6. 高级应用-闪光 [ 93%]

...e = 0; Laya.timer.frameLoop(1, this, loop); function loop() { scaleValue = Math.sin(scaleDelta += 0.01); pos1.elements[0] = pos2.elements[0] = scaleValue * 13; pos1.elements[1] = Math.sin(scaleValue * 20) * 2; pos2.elements[1] = Math.sin(scaleValue * 20) * 2; glitter.addGlitterByPositions(pos1, pos2...

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

7. Sprite-容器 [ 93%]

...只猩猩距离中心点150像素 var layoutRadius = 150; var radianUnit = Math.PI / 2; apesCtn = new Sprite(); Laya.stage.addChild(apesCtn); // 添加4张猩猩图片 for (var i = 0; i < 4; i++) { var ape = new Sprite(); ape.loadImage("../../res/apes/monkey" + i + ".png"); ape.pivot(55, 72); // 以...

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

8. 混合模式-Lighter [ 92%]

...eLoop(1, this, renderBg); } function createPhoenixes() { var scaleFactor = Math.min( Laya.stage.width / (phoenixWidth * 2), Laya.stage.height / phoenixHeight); // 加了混合模式的凤凰 var blendedPhoenix = createAnimation(); blendedPhoenix.blendMode = "lighter"; blendedPhoenix.scale(scaleFacto...

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

9. 射线检测-放置物体 [ 89%]

..."../../res/threeDimen/texture/layabox.png"); mat.albedo = new Laya.Vector4(Math.random(), Math.random(), Math.random(), 1); sphere.meshRender.material = mat; Laya.Vector3.add(_outHitInfo.position, _offset, _position); sphere.transform.position = _position; sphere.transform.rotate(new Laya.Vector3(0,...

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

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

...var 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, onMouseMove); } } function onMouseMove(e) { var touches = e.touches; if (touches && touches.leng...

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