大约有 1,546 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0070 秒)
...;,i*100,800,100,60); btn.id= i; btns.push(btn); this.btnBox.addChild(btn); console.log(btn.id); } for(var i = 0; i < 5; i++){ btns[i].on(Laya.Event.CLICK,this,judge,[i]); } function judge(aa){ console.log("___________"+aa); } 我就是这么做的,结果打印出来全是4,前面的...
来源: Laya_社区 发布时间: 20180817
....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
...LoadController中有个 public startLoad(){ if(LoadControl.isLaodSuccess){ console.log("加载成功了"); EventManager.Instance().BroadcastLisenter(GameEnum.load_success); }else{ console.log("开始加载进度了"); ResourceManager.Instance().loadSuccess(); // 这里改成不加载资源就能加...
来源: Laya_社区 发布时间: 20181213
...ent.MOUSE_DOWN, this, this.test2);//设置监听,sprite1或sprite2均可 console.log(this.sprite1.mouseEnabled);//打印父节点sprite1的MouseEnabled的值:true console.log(this.sprite2.mouseEnabled);//打印子节点sprite2的MouseEnabled的值:true } test2(e: Laya.Event) { console.log('mou...
来源: Laya3.0_文档 发布时间: 20250103
...moveDownBall = function(){ this.ball.x -= this.vx; this.ball.y += this.vy; console.log("111111"); this.vy *= 0.99; this.vy += 0.25; console.log("222222"); if (this.ball.y + this.vy >= this.stageHeight ||this.ball.y + this.vy <= 0) { this.vy = -this.vy; } if (this.ball.x + this.vx >= this.st...
来源: Laya_社区 发布时间: 20171107
...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
...eld this.compile())) { //确认编译结果 this.checkAllDir(""); } else { console.log("compile fail!"); } }); } 复制代码[/code] 其中__awaiter是一个编译工具函数,相当于async/await ,因为引擎项目是ES6的,所以使用这种方式实现异步执行的功能,想进一步...
来源: Laya_社区 发布时间: 20200925
...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
...n(Laya.Event.STOPPED, this, this.play); this.play(); } private onError() { console.error("load spine error"); } private play(): void { console.log("1111111111"); if (++this.index >= this.skeleton.getAnimNum()) { this.index = 0; } this.skeleton.play(this.index, false, true); } 正常示例 ...
来源: Laya_社区 发布时间: 20210813
...正确 sprite.scale(scaleRatio, scaleRatio); Laya.stage.addChild(sprite); console.log(sprite.width); console.log(sprite.height); 比如我在一个sprite的中心画一个圆,用scale放大后,圆偏离中心。 必须在原位置减去位置除以缩放比才能达到想要的效果。 附件 :...
来源: Laya_社区 发布时间: 20170821