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

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

111. tiledMap问题,getTileProperties获取地图属性不能获取到 [ 68%]

...ScreenPos(20,20); var pass = this.map.getTileProperties(0,idx - 1,'pass'); console.log('打印=======================================') console.log(idx, pass, this.map['_tileProperties'],this.map['_tileProperties2']); // 30 null {0:undefined} {} } }求官方给个回复 附件 : --> 2DTiled.zip 2019...

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

112. 获取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

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

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

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

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

115. Text无法识别换行符\n?? [ 67%]

...确实会把该符号识别为普通字符串。 这点我们可以通过console.log看出来。 当我们直接在代码里面定义一个 var a = xxx\nyyy 的时候,log输出是这样的: xxx yyy 而当我们从http请求拿到一个字符串 var b = xxx\nyyy 的时候,log输出是这样的...

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

116. image在相应loaded的时候,无法正确获取高度 [ 67%]

...or() { super(); this.on('start', this, this.init); } private init():void { console.log("init", this.x, this.y, this.width, this.height, this.scaleX, this.scaleY); var createOption: any = { isStatic: false, }; this.matterBody = Matter.Bodies.rectangle(this.x, this.y, this.width, this.height, createOp...

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

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

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

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

118. 微信小游戏,获取Laya.stage的宽高问题。 [ 67%]

微信小游戏,获取Laya.stage的宽高问题。 console.log("Laya.stage.height = ", Laya.stage.height); console.log("Laya.stage.width = ", Laya.stage.width);在加载完资源后,我打印了stage的宽高。在测试的时候,有一些机子出了问题。 正常的,安卓机测试 不...

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

119. localRotationEulerY旋转位置错误 [ 66%]

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

120. 升级到2.0后.原本用字符串索引module内的函数,发现不行了, 求指教 [ 66%]

...下.   例如: a.ts module proto{    export function msg1(){        console.log("msg1");    } }   b.ts module proto{    export function msg2(){        console.log("msg2");    } }   然后再main.ts里面. function dispatchMsg(name: string){   let fun = proto[name];   fun(); }  ...

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