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

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

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

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

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

62. Sprite-旋转缩放 [ 67%]

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

63. 灯光-方向光 [ 67%]

...ar animator = aniSprite3d.getComponentByType(Laya.Animator); animator.play(null, 1.0, 40, 70); }); var _quaternion = new Laya.Quaternion(); Laya.timer.frameLoop(1, null, function () { Laya.Quaternion.createFromYawPitchRoll(0.025, 0, 0, _quaternion); var _direction = directionLight.direction; Laya.Ve...

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

64. 射线检测-点击行走 [ 67%]

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

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

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

66. 关于缓动函数from的一些问题记录 [ 67%]

...rText,{y:100},3,Laya .Ease.backOut,new Handler(this,this.onEaseComplete),1,null,true); function onEaseComplete(){ console.log("ease complete"); Laya.stage.addChild(letterText); } ``` 以上的代码主要存在三个问题: 1. from()中的duration和delay都是以毫秒为单位,所以3,1想表示3...

来源: Laya_社区 发布时间: 20180620

67. laya.d3.math.Native.ConchVector3 [ 67%]

...r3(x:Number = 0, y:Number = 0, z:Number = 0, nativeElements:Float32Array = null) 创建一个 Vector3 实例。 ConchVector3  add(a:ConchVector3, b:ConchVector3, out:ConchVector3):void[static] 求两个三维向量的和。 ConchVector3  Clamp(value:ConchVector3, min:ConchVector3, max:ConchVecto...

来源: Laya2.0_api 发布时间: 20190513

68. 2D物理-仿生机器人 [ 67%]

.../** * 仿生兽 */ 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_示例 发布时间: 20241124

69. js环境下使用Loader加载图片在Sprite对象的.on函数无效 [ 66%]

...Handler.create(this, onAssetLoaded), loaderHandler.create(this, onLoading, null, false)); // 侦听加载失败     Laya.loader.on(Event.ERROR, this, onError);     this.moveover =true;     function onAssetLoaded(texture)     {         console.log("加载结束");       ...

来源: Laya_社区 发布时间: 20171024

70. 要做一个方形倒计时,请问该怎么实现,不知道该怎么做 [ 66%]

...eturn; } this.graphics.drawPie(pos,pos,r,START+(360 - value), 270 , COLOR ,null,0); } private function ef():void { if( TheGame.GetServerTime() > endTime ){ this.stop(); return; } var now:int = ( endTime - TheGame.GetServerTime() )/cdTime * 360; this.set360(now); } public function play(time:int,st...

来源: Laya_社区 发布时间: 20171124