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

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

1. 网络和格式-ProtocolBuffer [ 100%]

...obuf/awesome.proto", onAssetsLoaded); function onAssetsLoaded(err, root) { if (err) throw err; // Obtain a message type var AwesomeMessage = root.lookup("awesomepackage.AwesomeMessage"); // Create a new message var message = AwesomeMessage.create( { awesomeField: "AwesomeString" }); // Verify the me...

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

2. 其他引擎的Demo-Example_05 [ 96%]

...h (t) { case 0: for (i = 0; i tpoint1[i]) { tpoint1[i] = tpoint1[i] + 1; } if (points1[i] tpoint2[i]) { tpoint2[i] = tpoint2[i] + 1; } if (points2[i] tpoint3[i]) { tpoint3[i] = tpoint3[i] + 1; } if (points3[i] = []; private points2:Array = []; private points3:Array = []; private tpoint1:Array = []; ...

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

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

...ction start() { for (var i = 0; i w) { stars[i].x = stars[i].x - w; } else if (stars[i].x h) { stars[i].y = stars[i].y - h; } else if (stars[i].y = []; private w:number = Browser.width; private h:number = Browser.height; private slideX:number = this.w / 2; private slideY:number = this.h / 2; private...

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

4. 射线检测-碰撞器混合 [ 93%]

...age.on(Laya.Event.MOUSE_UP, this, drawCollider); } function onKeyDown(e) { if (e.keyCode == Laya.Keyboard.UP) this.layaMonkey.transform.translate(this._tempUnitX1); else if (e.keyCode == Laya.Keyboard.DOWN) this.layaMonkey.transform.translate(this._tempUnitX2); else if (e.keyCode == Laya.Keyboard.LE...

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

5. 输入设备-地图 [ 93%]

... 将原始坐标转换为百度坐标 function convertToBaiduCoord(data) { if (data.status == 0) { var position = data.points[0]; // 设置标注物位置 marker.setPosition(position); map.panTo(position); map.setZoom(17); } } function onError(e) { if (e.code == Geolocation.TIMEOUT) alert("获取位...

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

6. 其他引擎的Demo-Example_23 [ 92%]

....jpg"); Laya.stage.frameLoop(1, this, animate); })(); function animate() { if (tick > frequency) { tick = 0; // iterate through the dudes and update the positions var laser = new Sprite(); laser.loadImage("../../res/pixi/laser0" + ((type % 5) + 1) + ".png"); type++; laser.life = 0; var pos1; var pos...

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

7. 骨骼动画-换装 [ 89%]

....loop(1000, this, changeSkin); } function changeSkin() { mCurrSkinIndex++; if (mCurrSkinIndex >= mSkinList.length) { mCurrSkinIndex = 0; } mArmature.showSkinByName(mSkinList[mCurrSkinIndex]); } function completeHandler() { play(); } function play() { mCurrIndex++; if (mCurrIndex >= mArmature.getAnim...

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

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

... segments.length; i Laya.stage.width) targetPosition.x = Laya.stage.width; if (targetPosition.y Laya.stage.height) targetPosition.y = Laya.stage.height; } function checkEatFood() { var food; for (var i = foods.length - 1; i >= 0; i--) { food = foods[i]; if (food.hitTestPoint(targetPosition.x, target...

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

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

..., this, onMouseDown); } function onMouseDown(e) { 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) { va...

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

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

..., this, onMouseDown); } function onMouseDown(e) { var touches = e.touches; if (touches && touches.length == 2) { lastDistance = getDistance(touches); Laya.stage.on(Event.MOUSE_MOVE, this, onMouseMove); } } function onMouseMove(e) { var distance = getDistance(e.touches); //判断当前距离与上次...

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