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

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

1. 区块地图-等角地图 [ 100%]

...tage.width, Laya.stage.height), Laya.Handler.create(this, this.mapLoaded), null, new Point(1600, 800)); } onStageClick() { let p = new Laya.Point(0, 0); // 通过屏幕坐标来获取选中格子的索引 this.layer.getTilePositionByScreenPos(Laya.stage.mouseX, Laya.stage.mouseY, p); // 通过地图...

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

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

...ent.MOUSE_DOWN, this, onMouseDown); } private function onMouseDown(e:Event=null):void { var touches:Array = 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, onM...

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

3. 输入设备-指南针 [ 85%]

...nChange(absolute, info) { const Browser = Laya.Browser; if (info.alpha === null) { alert("当前设备不支持陀螺仪。"); } else if (firstTime && !absolute && !Browser.onIOS) { firstTime = false; alert("在当前设备中无法获取地球坐标系,使用设备坐标系,你可以继续观...

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

4. Sprite-容器 [ 84%]

...Laya.timer.frameLoop(1, this, animate); } private function animate(e:Event=null):void { apesCtn.rotation += 1; } } }

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

5. 鼠标交互-滑动 [ 81%]

...ild(graph); } /**按下事件处理*/ private function onMouseDown(e:Event=null):void { //添加鼠标移到侦听 Laya.stage.on(Event.MOUSE_MOVE, this, onMouseMove); buttonPosition = button.x; Laya.stage.on(Event.MOUSE_UP, this, onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, onMouseUp); } /**移...

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

6. 混合模式-Lighter [ 79%]

...{ r: channels[0], g: channels[1], b: channels[2] }, this.gradientInterval, null, Handler.create(this, this.onTweenComplete)); } private getColorChannals(color: number): Array { var result: Array = []; result.push(color >> 16); result.push(color >> 8 & 0xFF); result.push(color & 0xFF); return result;...

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

7. Sprite-旋转缩放 [ 73%]

...Laya.timer.frameLoop(1, this, animate); } private function animate(e:Event=null):void { ape.rotation += 2; //心跳缩放 scaleDelta += 0.02; var scaleValue:Number = Math.sin(scaleDelta); ape.scale(scaleValue, scaleValue); } } }

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

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

...ent.MOUSE_DOWN, this, onMouseDown); } private function onMouseDown(e:Event=null):void { var touches:Array = e.touches; if(touches && touches.length == 2) { lastDistance = getDistance(touches); Laya.stage.on(Event.MOUSE_MOVE, this, onMouseMove); } } private function onMouseMove(e:Event=null):void { v...

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

9. 2D物理-仿生机器人 [ 72%]

.../** * 仿生兽 */ export class Physics_Strandbeests { Main: typeof Main = null; private scale = 2.5; private pos: Array = [500, 400]; private m_offset: Array = [0, -80 * this.scale]; private pivot: Array = [0, 8 * this.scale]; private wheel: Sprite; private chassis: Sprite; private motorJoint: Revo...

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

10. UI-ProgressBar [ 70%]

...ndler.create(this, onLoadComplete)); } private function onLoadComplete(e:*=null):void { progressBar = new ProgressBar("../../res/ui/progressBar.png"); progressBar.width = 400; progressBar.x = (Laya.stage.width - progressBar.width ) / 2; progressBar.y = Laya.stage.height / 2; progressBar.sizeGrid = "...

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