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

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

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

...效。(function() { var Sprite = Laya.Sprite; var Stage = Laya.Stage; var Point = Laya.Point; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var viewWidth = Browser.width; var viewHeight = Browser.height; var lasers = []; var tick = 0; var frequency = 80; var type = 0; (function() { Laya.init(v...

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

2. 输入设备-地图 [ 98%]

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

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

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

...aya.Stage; var MapLayer = Laya.MapLayer; var TiledMap = Laya.TiledMap; var Point = Laya.Point; var Rectangle = Laya.Rectangle; var Handler = Laya.Handler; var WebGL = Laya.WebGL; var tiledMap; var layer; var sprite; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(1600, 800, WebGL);...

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

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

...ationInfo = Laya.AccelerationInfo; var Accelerator = Laya.Accelerator; var Point = Laya.Point; var Browser = Laya.Browser; var Handler = Laya.Handler; var WebGL = Laya.WebGL; function Segment(width, height) { Segment.super(this); Segment.prototype.init = function() { this.graphics.drawRect(-height /...

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

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

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

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

6. 射线检测-放置物体 [ 93%]

... = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); var point = new Laya.Vector2(); var _outHitInfo = new Laya.RaycastHit(); function checkHit() { //从屏幕空间生成射线 point.elements[0] = Laya.MouseManager.instance.mouseX; point.elements[1] = Laya.MouseManager.instance.mo...

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

7. 射线检测-点击行走 [ 93%]

... = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); var point = new Laya.Vector2(); var _position = new Laya.Vector3(0, 0.25, 0); var _quaternion = new Laya.Quaternion(); var _outHitInfo = new Laya.RaycastHit(); function checkHit() { box.transform.position = _position; box.transfo...

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

8. 射线检测-选取物体 [ 87%]

... = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); var point = new Laya.Vector2(); var _outHitAllInfo = new Array(); function checkHit() { //从屏幕空间生成射线 point.elements[0] = Laya.MouseManager.instance.mouseX; point.elements[1] = Laya.MouseManager.instance.mouseY; c...

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

9. 射线检测-射线检测 [ 83%]

... = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); var point = new Laya.Vector2(); var _corners = new Array(); _corners[0] = new Laya.Vector3(); _corners[1] = new Laya.Vector3(); _corners[2] = new Laya.Vector3(); _corners[3] = new Laya.Vector3(); _corners[4] = new Laya.Vector3();...

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