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

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

1. 请问laya2.0 2d物理有射线检测功能吗 [ 100%]

...同来自: Smile~ // RayCast方法: // world.RayCast(callback:Function,point1:b2Vec2,point2:b2Vec2); // * callback 回调函数 // * point1 射线的起点 // * point2 射线的终点 // 回调函数: // function(fixture:b2Fixture,point:b2Vec2,normal:b2Vec2,fraction:Number):Number // * fixture ...

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

2. 用raycast选取实体,hitresult始终是false [ 96%]

...件的核心代码就那么点:  //**** 监测鼠标点击碰撞 */ var point = new Laya.Vector2(); var ray: Laya.Ray = new Laya.Ray(new Laya.Vector3(2, 2, 2), new Laya.Vector3(3, 3, 3)); var outHitResult: Laya.HitResult = new Laya.HitResult(); point.x = Laya.MouseManager.instance.mouseX; point.y...

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

3. 使用localToGlobal方法获取list单元格错误不准确 [ 92%]

...box单元格是同一个 localToGlobal: function (ele, flag) {      var point = new laya.maths.Point(ele.pivotX, ele.pivotY);     // flag = flag ? true : false;     return ele.localToGlobal(point, flag);  }   console.log(box); var targetXY = Utils.localToGlobal(box, false);  console.log(...

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

4. localRotationEulerY旋转位置错误 [ 90%]

...void {         //创建盒型MeshSprite3D          let point = [{ x: 0, z: 0 }, { x: -2, z: 2 }];          var box = this.newScene.addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(0.75, 0.5, 0.5))) as Laya.MeshSprite3D;         //...

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

5. 怎么计算两个点之间的距离 [ 87%]

...复 cuixueying 赞同来自: jinghuhuilai             var p1:Point = new Point(10,20);              var p2:Point = new Point(100,200);              var x:int = p1.x - p2.x;              var y:int = p1.y = p2.y;           ...

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

6. 发射射线检测不到,物体有包围盒 [ 87%]

..., 0, 0));               }      onMouseDown() {         this.point.x = Laya.stage.mouseX;         this.point.y = Laya.stage.mouseX;         //产生射线         this.camera.viewportPointToRay(this.point,this._ray);         //拿到射线碰撞的物体         thi...

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

7. Cannot read property 'rayCast' of undefined [ 86%]

...constructor(){ super(); this.rotation = new Laya.Vector3(0, 0.01, 0); this.point = new Laya.Vector2(); this.ray = new Laya.Ray(new Laya.Vector3(),new Laya.Vector3()); //1.开启第四个参数 let config3D = new Laya.Config3D(); config3D.isAlpha = true; Laya3D.init(0, 0, config3D); Laya.stage.scaleM...

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

8. 裁切图片后,该用什么方式去重绘出裁切后的图片 [ 85%]

...用Laya.Render.context中的方法去重绘,绘制部分代码如下(points,是我裁切后的多边形位置点数据): draw() {         const pp = this.owner.getComponent(Laya.PolygonCollider).points;         let points = this.pointS_to_pointA(pp)         let...

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

9. 【分享】圆形进度条上图片跟随进度并旋转角度 [ 83%]

..., 216, -90, (-90 + Math.floor(percent * 360)), "#ff0000"); //画进度 let point: { x: number, y: number, hudu: number } = this.cal(216, 216, 205, Math.abs(Math.floor(percent * 360) ) - 90); //现在是顺时针,如果逆时针旋转 Math.abs(Math.floor(percent * 360) -360) this.view.img_light.x =...

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

10. tween有这个一个bug [ 83%]

...lay(0,true); 然后循环创建依次执行ui的延迟动画 Laya.Tween.to(point,{x:point.x,y:point.y,alpha:1,update:Laya.Handler.create(point,function(){ this.visible = true; })},800,Laya.Ease.backOut,null,i*400); timeline在一开始还在正常执行, 当有一半左右的ui元素进入到场景...

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