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

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

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

...Point = Laya.Point; for (let i = 0; i 0) { let prevSeg = segments[segments.length - 1]; seg.rotation = prevSeg.rotation; let point = seg.getPinPosition(); seg.x = prevSeg.x - point.x; seg.y = prevSeg.y - point.y; } segments.push(seg); } animate() { let seg = segments[0]; // 更新蛇的位置 target...

来源: Laya2.0_示例 发布时间: 20241118

2. 混合模式-Lighter [ 97%]

...th.floor(bgColorChannels.b); var r = bgColorChannels.r.toString(16); r = r.length == 2 ? r : "0" + r; var g = bgColorChannels.g.toString(16); g = g.length == 2 ? g : "0" + g; var b = bgColorChannels.b.toString(16); b = b.length == 2 ? b : "0" + b; return "#" + r + g + b; } } new BlendMode_Lighter();...

来源: Laya2.0_示例 发布时间: 20241118

3. 其他引擎的Demo-Example_21 [ 96%]

...ics; } onMouseDown() { isDown = true; color = colors[colorCount++ % colors.length]; path.length = 0; } onMouseMove() { if (!isDown) return; path.push(Laya.stage.mouseX); path.push(Laya.stage.mouseY); } onMouseUp() { isDown = false; canvasGraphics.drawPoly(0, 0, path.concat(), color); } animate() { l...

来源: Laya2.0_示例 发布时间: 20241118

4. UI-Button [ 96%]

...UTTON_WIDTH) / 2; yOffset = (Laya.stage.height - VERTICAL_SPACING * (skins.length / COLUMNS - 1) - BUTTON_HEIGHT) / 2; Laya.loader.load(skins, Handler.create(this, this.onUIAssetsLoaded)); } onUIAssetsLoaded() { for (let i = 0, len = skins.length; i ; constructor() { // 不支持WebGL时自动切换...

来源: Laya2.0_示例 发布时间: 20241118

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

...上才有 touches 属性 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 (to...

来源: Laya2.0_示例 发布时间: 20241118

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

...上才有 touches 属性 let touches = e.touches; if (touches && touches.length == 2) { lastDistance = this.getDistance(touches); Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove); } } onMouseMove(e) { let distance = this.getDistance(e.touches); //判断当前距离与上次距离变化,确...

来源: Laya2.0_示例 发布时间: 20241118

7. 性能测试-骨骼 [ 92%]

...0; i = tAnimNum) { mActionIndex = 0; } for (let i = 0, n = mAnimationArray.length; i = []; private mFactory: Templet; constructor() { this.mSpacingX = Browser.width / this.colCount; this.mSpacingY = Browser.height / this.rowCount; Laya.init(Browser.width, Browser.height, WebGL); Stat.show(); this.mT...

来源: Laya2.0_示例 发布时间: 20241118

8. 2D物理-仿生机器人 [ 91%]

... dampingRatio; leg1.addComponentIntance(distanceJoint1); distanceJoint1.maxLength = distanceJoint1.minLength = distanceJoint1.length || distanceJoint1.joint.GetLength() * Laya.Physics.PIXEL_RATIO; let distanceJoint2 = new Laya.DistanceJoint(); distanceJoint2.otherBody = legBody2; distanceJoint2.self...

来源: Laya2.0_示例 发布时间: 20241118

9. UI-Input [ 87%]

...s, this.onLoadComplete)); } onLoadComplete() { for (let i = 0, len = skins.length; i ; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Lay...

来源: Laya2.0_示例 发布时间: 20241118

10. 骨骼动画-换装 [ 87%]

...p(1000, this, this.changeSkin); } changeSkin() { mCurrSkinIndex++; let skinLength = mSkinList.length; if (mCurrSkinIndex >= skinLength) { mCurrSkinIndex = 0; } mArmature.showSkinByName(mSkinList[mCurrSkinIndex]); } completeHandler() { this.play(); } play() { mCurrIndex++; let aniNum = mArmature.getA...

来源: Laya2.0_示例 发布时间: 20241118