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

大约有 6,579 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0112 秒)

291. 碰撞检测 outHitInfo.distance 一直等于 -1 ?(TS代码) [ 89%]

...*/ private outHitInfo:Laya.RaycastHit; constructor() { super(); this.ray = new Laya.Ray(new Laya.Vector3(0,0,0),new Laya.Vector3(0,-2,0)); this.outHitInfo = new Laya.RaycastHit(); } /*覆写3D组件方法,指3D对象加载组件时执行 *owner:此组件所属的3D对象 */ public _load(owner:La...

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

292. 如何获得box单独每个面的material [ 89%]

...处理, threejs做起来这个很简单, 这个就搞晕我了 var mesh = new Laya.BoxMesh(ConstValue.boxWidth, ConstValue.boxWidth, ConstValue.boxHeight); var box = this.parent.addChild(new Laya.MeshSprite3D(mesh)); box.transform.rotate(new Laya.Vector3(0, 45, 0), false, false); box.transform.posit...

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

293. list item 添加事件后无法监听 [ 89%]

...istView(x, y, width, height, item_width, item_height) {     var list = new Laya.List();     list.itemRender = initItem(item_width, item_height);      list.repeatX = 1;     list.size(width, height);     list.x = x;     list.y = y;     list.vScrollBarSkin = "";      l...

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

294. 区块地图-滚动地图 [ 88%]

...Browser = Laya.Browser; mX = mY = 0; // 创建地图对象 this.tiledMap = new TiledMap(); // 创建地图,适当的时候调用destory销毁地图 this.tiledMap.createMap("res/tiledMap/desert.json", new Rectangle(0, 0, Browser.width, Browser.height), new Handler(this, this.completeHandler)); } //...

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

295. 设置滤镜(JavaScript-LayaAir基础篇(JS)-位图) [ 88%]

...0, 0, 0, 0, //B 0, 0, 0, 1, 0, //A ]; //创建颜色滤镜 var redFilter = new Laya.ColorFilter(colorMatrix) ``` 最后通过Spriter的filters属性将颜色滤镜效果叠加到位图中。下面我们创建一个Main.js类,编写代码如下: ```javascript (function() { var Sprite = Laya.Sprit...

来源: Laya2.0_文档 发布时间: 20210714

296. 最近在用laya做资源优化的时候,发现一个问题,就是把图片资源从内存中释放掉后,下次想再显示这个图片的时候就出现不显示,然后要重现new才可以 [ 88%]

...下次想再显示这个图片的时候就出现不显示,然后要重现new才可以 我们这边有好几个项目都有这个问题,然后现在的处理就是下次要显示的时候就重新new,然后再加载图片资源,这样就是游戏旧了会出现手机会发烫的问题。 附...

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

297. webgl模式下对Panel组件旋转时Panel子对象显示错误的BUG! [ 88%]

...题 console.log(Laya.version); var testSpriteRotation:PanelRotationTest = new PanelRotationTest(Laya.Sprite); testSpriteRotation.pos(300,260); Laya.stage.addChild(testSpriteRotation); var testPanelRotation:PanelRotationTest = new PanelRotationTest(Laya.Panel); testPanelRotation.pos(1000,260); Laya.s...

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

298. 输入设备-指南针 [ 88%]

...前所朝方位 createCompass() { const Sprite = Laya.Sprite; compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } createDirectionIndicator() { con...

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

299. 分享:Graphics下cmds命令流的使用! [ 88%]

...oader.getRes('apes/monkey3.png') as Texture; //绘制纹理 var box:Sprite=new Sprite(); Laya.stage.addChild(box); box.graphics.drawTexture(texture1,50,50,0,0,new Matrix(),0.5); box.graphics.drawTexture(texture2,200,50,0,0,new Matrix(),0.5); box.graphics.drawTexture(texture3,350,50,0,0,new Matrix(),...

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

300. 滤镜-发光滤镜 [ 88%]

...his.applayFilter(); } createApe() { const Sprite = Laya.Sprite; this.ape = new Sprite(); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.graphics.drawTexture(texture); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.he...

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