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

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

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

...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_示例 发布时间: 20241118

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

...效。(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_示例 发布时间: 20241118

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

...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_示例 发布时间: 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); ...

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

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

...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_示例 发布时间: 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); var label = new BMap.Label("当前位置", { offset: new BMap.Size(-15, 30) }); mar...

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

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

... = 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_示例 发布时间: 20241118

8. 射线检测-点击行走 [ 89%]

... = 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_示例 发布时间: 20241118

9. 射线检测-选取物体 [ 81%]

... = 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_示例 发布时间: 20241118

10. 射线检测-射线检测 [ 76%]

... = 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_示例 发布时间: 20241118