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

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

161. 经验分享:如何控制龙骨动画的播放索引! [ 76%]

...te function omTemLoaded():void { mArmature=mFactory.buildArmature(0); Laya.stage.addChild(mArmature); Laya.stage.on(Event.CLICK,this,onClick); mArmature.play(0,false);//设置初始位置 mArmature.index=this.index; mArmature.pos(500,500) } private function onClick():void { mArmature.play("stand",tr...

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

162. 小米手机三指点击后,后续获得的触摸点失效 [ 76%]

...的触摸点失效,单点的情况下会获得三个触摸点信息Laya.stage.on(Laya.Event.MOUSE_DOWN, this, (data: Laya.Event) => { let str = ""; if (data.touches) { for (let i = 0; i < data.touches.length; i++) { str += ` {${i} : ${data.touches[i].pos.toString()}}`; } } console.log("drag ...

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

163. laya.physics.Physics_API3.0 [ 76%]

...此容器作为物理世界坐标世界,进行坐标变换,默认值为stage 设置特定容器后,就可整体位移物理对象,保持物理世界不变。 注意,仅会在 set worldRoot 时平移一次,其他情况请配合 updatePhysicsByWorldRoot 函数使用 Returns Sprite Defined ...

来源: Laya3.0_api 发布时间: 20231115

164. 使用webgl之后toDataUrl返回黑色的图像 [ 75%]

...Sprite#drawToCanvas() 这片文档,我使用以下代码应该ok   Laya.stage.getChildAt(0).drawToCanvas(100, 100, 0, 0).getCanvas().toDataURL(); 但在WebGL的模式下,实现在laya.core.js的20644行,drawToCanvas返回的是pixels:Uint8Array,这东西怎么变成HTMLCanvas?   如果...

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

165. 取消监听鼠标移动事件,取消不了 [ 75%]

取消监听鼠标移动事件,取消不了 Laya.stage.off(Laya.Event.MOUSE_MOVE,this,null); 第三个参数是函数,不能为null吗?是不是和on绑定时的同一个函数,如果on里面用匿名函数,off第三个参数怎么写? 2018-06-23 添加评论 免费帖 --> 分享 微博...

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

166. 分享一下自己的屏幕适配方案 [ 75%]

分享一下自己的屏幕适配方案 废话不多说 上代码 Laya.stage.scaleMode = Laya.Stage.SCALE_FULL nWidth:number; nHeight:number; ImgX:number; ImgY:number; Img:Laya.Image =new Laya.Image(); this.nWidth =this.bg.width; //背景图宽 this.nHeight =this.bg.height;//背景图的高 this....

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

167. 如何监听键盘组合键 [ 75%]

...: 与内容相关的链接 提交 2 个回复 Laya_XS 赞同来自: Laya.stage.on(Event.KEY_DOWN, this, _onKeyDown); 然后你根据Keyboard对应的keycode来判断是什么键即可 2018-04-06 0 0 分享 微博 QZONE 微信 akunone 赞同来自: laya.events.KeyBoardManager.hasKeyDown(laya.events.K...

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

168. Spine适配版(JavaScript-LayaAir基础篇(JS)-动画基础) [ 75%]

... -1; constructor() { Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; Stat.show(); this.startFun(); } private startFun(): void { //创建动画模板 this.templet = new SpineTempletBinary(); this.templet.loadAni(this.aniPath...

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

169. Animation类如何调用complete事件 [ 74%]

...adyAni.loadAnimation("Ready.ani"); readyAni.interval = 100; Laya.stage.addChild(readyAni); readyAni.play(0,false); readyAni.on(EVENT.COMPLETE, null, onComplete); } 在方法外有个 function onComplete() { console.log('3'); readyAni.destroy(); } 但是报错 chenhuanqi23 • 2017-09-27 15...

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

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

... 没办法发图了 class Main { constructor() { Laya.init(480, 852); Laya.stage.scaleMode = "showall"; Laya.stage.alignV = 'middle'; Laya.stage.alignH = 'center'; Laya.stage.screenMode = "vertical"; Laya.stage.bgColor = "#101825"; this.init() } init() { // 预加载图...

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