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

大约有 1,020 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0084 秒)

321. 获取sprite对象的 width和height为0 [ 68%]

....Rectangle = bg.getBounds(); var btBound: Laya.Rectangle = bg.getBounds(); console.log(bgBound.width/2) console.log(bgBound.height - 150) bt.pos(bgBound.width/2 - btBound.width/2,bgBound.height - 150) } } //启动游戏 new Game();打印结果: 0 -150 bgBound.width 和 bgBound.heigt 都为0  2016...

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

322. 微信小游戏分包实战(JavaScript-小游戏适配文档-微信小游戏) [ 68%]

...。示例代码如下: ```javascript loadTask.onProgressUpdate(res => { console.log('下载进度', res.progress) console.log('已经下载的数据长度', res.totalBytesWritten) console.log('预期需要下载的数据总长度', res.totalBytesExpectedToWrite) }) ``` 本篇文档主要是讲分...

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

323. Laya.Sprite loadImage 参数问题 [ 68%]

...teImg(280,50); //添加红色颜色滤镜效果 img.filters = [redFilter]; console.log('b'); } /**创建灰色滤镜位图**/ private createGrayFilter():void{ //颜色滤镜矩阵,灰色 var colorMatrix:any = [ 0.3086, 0.6094, 0.0820, 0, 0, //R 0.3086, 0.6094, 0.0820, 0, 0, //G 0.3086, 0.6094, 0.082...

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

324. 求问sprite放大后,graphics绘制的图像位置偏移 [ 68%]

...正确 sprite.scale(scaleRatio, scaleRatio); Laya.stage.addChild(sprite); console.log(sprite.width); console.log(sprite.height); 比如我在一个sprite的中心画一个圆,用scale放大后,圆偏离中心。 必须在原位置减去位置除以缩放比才能达到想要的效果。 附件 :...

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

325. TS项目,index.html 里面的js代码如何调用项目里面的函数,window.addEventListener 在ts项目里面该怎么写 [ 68%]

....addEventListener('message', function(e) {                 console.log(e.data);        //分享成功之后这个参数是true         }, false);     </script>   window.addEventListener 在ts项目里面该怎么写  是直接这样写,还是这样写:...

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

326. load方法加载cdn上面的图片资源的时候直接报了跨域不同源的问题,怎么破? [ 68%]

...essBar.png', STATIC_IMG_PATH+'progressBar$bar.png' ]; this.isFirst = true; console.log('Gzdaze='); console.log(Gzdaze); Laya.loader.load(Gzdaze.dialogList, Handler.create(this, this.startLoaded)); 代码是这样的 报错 Access to Image at 'http://caifu-1251177394.file.myqcloud.com/beta/book/bookL...

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

327. 通过laya设计模式制作的,要怎么给按钮绑定事件呢? [ 68%]

...dChild(new TabUI()) this.getGold.on(Laya.Event.MOUSE_DOWN,this,function(){ console.log("点击事件") }) // console.log(this.getGold) } } new Main() Laya_Aaron • 2017-12-13 17:09 getGold 哪定义的呢 xdkaka • 2017-12-13 17:17 上面图片截图了,是在UI编辑模式下 -公用-...

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

328. localRotationEulerY旋转位置错误 [ 68%]

...rigidBody.mass = 10;         this.arr.push(box);         console.log("position = ",box.transform.position);         if (index == 1) {             Laya.timer.once(1000,this,()=>{                 this.setAngle();             })...

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

329. Laya3d球星添加了刚体,但是碰撞无法触发onTriggerEnter的问题,120元有偿悬赏解答 [ 68%]

... onTriggerEnter,onTriggerStay,onTriggerExit 方法,并且在方法内有console.log输出,player设置了点击z方向向前移动   2、GameManager.ts:40-41行获取被碰撞体、72-94行管理被碰撞体和给每个被碰撞体添加了刚体,同时 isTrigger =true,isKinematic=true,...

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

330. 通过getChildByName找到的dialog节点使用show方法后, 再次getChildByName查找, 结果为null [ 68%]

... let childNode = parentNode.getChildByName('Dialog'); childNode.show();   console.log(parentNode.getChildByName('Dialog'));  // 结果为null   2016-09-13 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 2 个回复 cuixueyi...

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