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

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

111. 怎么才能像HTML5中那样直接操作Canvas [ 68%]

...10, 150, 150,"red"); ctx.fillText("texttt",100,100,"","#ffffff","center"); console.log("draw complete"); 2017-05-02 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 cuixueying 赞同来自: LayaAir也是基于canvas...

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

112. Laya下的图片上传示例(完整版) [ 68%]

...y):void { if(file.files.length>0) { if(20*1024<file.files[0].size) { console.log("图片大小不能超过20kb!") }else{ fileReader.readAsDataURL(file.files[0]); //转换图片格式为字符编码 } } }; fileReader.onload = function(e):void { if(Laya.Browser.window.FileReader.DONE == fileRead...

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

113. 使用外部引擎播放layaair制作的.ani [ 68%]

...; //播放Animation动画 tl.play(); tl.on(Event.COMPLETE, this, () => {console.log('end')}); } 2018-08-23 0 2 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 zyx 相关问题 看了其他引擎才发现 LAYA 真的太太太太好用了!...

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

114. matter中有没有类似于unity中的OnCollision碰撞检测函数呀,用js怎么写 [ 68%]

...', this.onCollision);   2.碰撞检测 private onCollision(event): void { console.log("碰撞了..");  var home = _gamePage._mainPage._playPage;  for(var i = 0; i < event.pairs.length; i++) {  var pair = event.pairs[i];  if(!(pair.bodyA.label === 'gun' || pair.bodyB.label == "gun")) continue...

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

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

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

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

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

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

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

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

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

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

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