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

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

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

... 0, Laya.stage.width, Laya.stage.height), Handler.create(this, mapLoaded), null, new Point(1600, 800)); } function onStageClick() { var p = new Point(0, 0); layer.getTilePositionByScreenPos(Laya.stage.mouseX, Laya.stage.mouseY, p); layer.getScreenPositionByTilePos(Math.floor(p.x), Math.floor(p.y), p...

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

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...

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

3. Sprite3D-Sprite3D变换 [ 87%]

..., 0)); layaMonkey3 = scene.addChild(Laya.Sprite3D.instantiate(layaMonkey1, null, false, new Laya.Vector3(0.6, 0, 0))); Laya.timer.frameLoop(1, this, animate); } var _position = new Laya.Vector3(-0.6, 0, 0); var _rotate = new Laya.Vector3(0, 1, 0); var _scale = new Laya.Vector3(); var scaleDelta = 0;...

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

4. 射线检测-放置物体 [ 86%]

...form.rotate(new Laya.Vector3(-15, 0, 0), true, false); camera.clearColor = null; //方向光 var directionLight = scene.addChild(new Laya.DirectionLight()); directionLight.color = new Laya.Vector3(0.6, 0.6, 0.6); directionLight.direction = new Laya.Vector3(1, -1, -1); //平面 var plane = scene.addC...

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

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

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

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

6. Sprite-容器 [ 84%]

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

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

7. 高级应用-Laya3D与网页混合 [ 82%]

...r3(-15, 0, 0), true, false); //3.清除照相机颜色 camera.clearColor = null; var directionLight = scene.addChild(new Laya.DirectionLight()); directionLight.direction = new Laya.Vector3(0, -0.8, -1); directionLight.color = new Laya.Vector3(0.7, 0.6, 0.6); var layaMonkey = scene.addChild(Laya.Spri...

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

8. 鼠标交互-滑动 [ 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); } /**移...

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

9. 混合模式-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;...

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

10. Sprite3D-Sprite3D克隆 [ 77%]

...r layaMonkey_clone2 = scene.addChild(Laya.Sprite3D.instantiate(layaMonkey, null, false, new Laya.Vector3(-0.6, 0, 0))); }class Sprite3DClone { private scene: Laya.Scene; constructor() { Laya3D.init(0, 0, true); Laya.stage.scaleMode = Laya.Stage.SCALE_FULL; Laya.stage.screenMode = Laya.Stage.SCREEN_N...

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