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

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

1391. 切换位图,点击图片距离容器的区域也会触发点击事件 [ 53%]

...assets/comp/haoyuobang-hui.png"; var img = new Laya.Sprite(); //实例 img.width = 300; //宽高 img.height = 200; switchImg(); img.on(Laya.Event.CLICK, this, switchImg) //点击事件 Laya.stage.addChild(img); function switchImg() { img.graphics.clear(); //清除绘制 var imgUrl = (this.flag = !th...

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

1392. sprite 添加点击事件没反应,对sprite设置了size也没用 [ 53%]

...w.music.btn_on) ; this.btn.pivot(75/2 , 75/2) ; this.btn.x = window.client_width - 25 ; this.btn.y = 25 ; this.btn.scaleX = 25 / 75 ; this.btn.scaleY = 25 / 75 ; Laya.stage.addChild(this.btn) ; this.btn.size(25,25) ; this.btn.on(Laya.Event.CLICK, this, music.music_voice_toggle); 代码是这样的 ...

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

1393. 元素自动排列的问题,比如在昵称后面显示性别图标,怎么让图标根据昵称长度排列在其后面呢? [ 53%]

... 1、你可以获取你昵称的长度,图标的位置就是text.x+text.width 2、你也可以通过html富文本实现图片和文字同时显示,它会自动排版 3、你也可以借助hbox对其进行排版! 2017-09-06 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠...

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

1394. 想绘制一个自适应得圆角矩形框,失败了,求解惑 [ 53%]

...r login = (function(_super){ function login(){ login.super(this); var stageWidth = Laya.stage.width; var stageHeight = Laya.stage.height; console.log(stageWidth*0.05+":"+stageHeight); var path = [ ["moveTo",stageWidth*0.05,0], ["actTo",stageWidth*0.8,0,stageWidth*0.8,stageHeight*0.05,10], ["actTo",s...

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

1395. 分享:TiledMap设置viewport后黑屏问题! [ 53%]

...s/tiledMap/orthogonal-test-movelayer.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), Handler.create(this,onLoaded)); } //切记:设置tiledMap的宽高,需要在地图创建完成之后 private function onLoaded():void { var sp:Sprite=tiledMap.mapSprite() as Sprite;//为tiledMap...

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

1396. scaleMode 用法 [ 53%]

...种模式 1、场景有拉伸,但是可以全屏显示,esactfit、fixedwidth、fixedheight 2、场景按照最长边或者短边去等比缩放,不会有拉伸,但是可能会出现裁剪或者留空白边  showall、noborder 3、自动适配fixedwidth、fixedheight,按照屏幕的宽高...

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

1397. 请问,怎么写代码能直接调用canvas 内的发光滤镜? [ 53%]

...实现了部分渐变功能。   spbg.graphics.drawPath(0,0, radius(spbg.width,spbg.height,10),{ fillStyle: gradient});  请问怎么写代码能调用下面的canvas原生代码?不用Laya的滤镜。 (Laya滤镜和webgl捆绑了)                         context.shado...

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

1398. layaAir中Animation无法获得宽高,很多逻辑无法判断 [ 53%]

...) this.animation.play(); this.addChild( this.animation ); this.animation.width 一直为0 2016-11-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 2 个回复 qq_别天神 赞同来自: 使用getBounds ()来获取宽高,...

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

1399. 参考例子使用 dom video播放 不显示能听到视频声音 [ 53%]

...一下 Utils.fitDOMElementInArea(videoElement, reference, 0, 0, reference.width, reference.height); 就可以了 zIndex 或者 zInddex 效果都一样 bona2000 • 2017-12-04 17:24 建立例子里 说明一下 监听可能无效 需要手工执行

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

1400. this.bitmap.activeResource is not a function. [ 53%]

... Laya.Sprite(); sprite.graphics.drawTexture(rankTexture, 0, 0, rankTexture.width, rankTexture.height); this._content.addChild(sprite); sprite.pos(40, 190);报:this.bitmap activeResource is not a function 2019-09-20 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已...

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