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

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

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

...ction initSnake() { for (var i = 0; i 0) { var prevSeg = segments[segments.length - 1]; seg.rotation = prevSeg.rotation; var point = seg.getPinPosition(); seg.x = prevSeg.x - point.x; seg.y = prevSeg.y - point.y; } segments.push(seg); } function animate() { var seg = segments[0]; // 更新蛇的位...

来源: Laya_示例 发布时间: 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; } })();module laya { import ...

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

3. UI-Button [ 95%]

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

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

4. 其他引擎的Demo-Example_21 [ 95%]

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

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

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

... 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) { var touches = e.touches; ...

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

6. 缓动-逐字缓动 [ 92%]

...ght / 2 - 50; var demoString = "LayaBox"; for (var i = 0, len = demoString.length; i > 1; var endY: number = Laya.stage.height / 2 - 50; var demoString: string = "LayaBox"; for (var i: number = 0, len: number = demoString.length; i > 1; var endY:int = Laya.stage.height / 2 - 50; var demoString:Strin...

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

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

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

8. 性能测试-骨骼 [ 88%]

...0; i = tAnimNum) { mActionIndex = 0; } for (var 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...

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

9. 动画-旧版骨骼动画 [ 85%]

...nAniUrl[0]); skinAni.player.play(); } for (var i = 0, n = spirit3D._childs.length; i = [ "../../res/threeDimen/skinModel/Zombie/old/Assets/Zombie/Model/z@walk-walk.lsani", "../../res/threeDimen/skinModel/Zombie/old/Assets/Zombie/Model/z@attack-attack.lsani", "../../res/threeDimen/skinModel/Zombie/ol...

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

10. 高级应用-渲染纹理 [ 83%]

...rite = spirit3D; for (var i = 0; i < meshSprite.meshRender.sharedMaterials.length; i++) { var mat = meshSprite.meshRender.sharedMaterials[i]; mat.disableLight(); } } for (var i = 0; i < spirit3D._childs.length; i++) setMaterials(spirit3D._childs[i]); }class RenderTextureDemo { private scene: Laya.Sc...

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