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

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

291. 和原生Dom交互 · LayaAir3.3 · 引擎文档 · LAYABOX [ 49%]

...tring = "http://layabox.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,this.clickHandler); this.qrcodeSp = new Laya.Sprite(); Laya.stage.addChild(this.qrcodeSp); 编译运行上面的代码,然后点击舞台可以看到,二维码已经显示到了舞台上,可以用手机扫...

来源: Laya3.0_文档 发布时间: 20251010

292. 【官网代码】加载dom音频报错,怎么回事? [ 49%]

...audioContext.createAnalyser();analyser.fftSize = 256;Laya.stage.once(Event.CLICK,this,clickHandler); }private function clickHandler(e:Object):void{var http:HttpRequest = new HttpRequest();http.on(Event.COMPLETE,this,completeHandler);http.send("489.mp3","","get",Loader.BUFFER);}private function comp...

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

293. 模型的功能介绍(ActionScript-3D基础(AS3)-LayaAir3D之模型和网格) [ 49%]

...nt = 0; //.............按钮点击事件 监听 changeMeshButton.on(Event.CLICK, this, function():void{ index++; if (index % 5 === 1 ){ //切换mesh sphere.meshFilter.sharedMesh = box; } else if (index % 5 === 2){ //切换mesh sphere.meshFilter.sharedMesh = capsule; } else if(index % 5 === 3){ //...

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

294. LAYABOX游戏实时语音之APP版本 [ 49%]

...iew extends ui.LoginUI { constructor() { super(); this.login.on(Laya.Event.CLICK, this, this.Loginyim); this.joinroom.on(Laya.Event.CLICK, this, this.JoinRoom); this.RecordAudio.on(Laya.Event.MOUSE_DOWN, this, this.StartRecordAudio); this.RecordAudio.on(Laya.Event.MOUSE_UP, this, this.StopRecordAudi...

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

295. 2.x引擎项目升级说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 49%]

....Script命名函数方式处理输入。例如: this.aNode.on(Laya.Event.CLICK, ()=> { console.log("clicked"); }); class MyScript extends Laya.Script { //脚本事件 onMouseClick(e:Event) { console.log("clicked"); } } aNode.addComponent(MyScript); 以上两种方式是等价的,且在纯2D...

来源: Laya3.0_文档 发布时间: 20251010

296. 如何实现3d遮罩效果? [ 48%]

...pixelRatio / 2, Laya.stage.height - 50 * Browser.pixelRatio); btn.on(Event.CLICK, _this, onclick); Laya.stage.addChild(btn); Laya.stage.on(Event.RESIZE, null, function():void { btn.pos(Laya.stage.width / 2 - btn.width * Browser.pixelRatio / 2, Laya.stage.height - 50 * Browser.pixelRatio); }); })); }...

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

297. sprite做的按钮点击无反应? [ 48%]

...enter"); //dialog_mc.addChild(btn); Laya.stage.addChild(btn); btn.on(Event.CLICK, this, function(){ alert("点击"); }); 点击btn并未弹出alert,我也设置了btn的size,这是为什么? 2017-01-20 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: ...

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

298. 分享:Panel下动态修改子容器宽高并刷新显示! [ 48%]

...ge.addChild(btnAdd); btnAdd.x=550; btnAdd.label='ADD1000'; btnAdd.on(Event.CLICK,this,onClick,[sp,panel]); } private function onClick(sp:Sprite,panel:Panel):void { trace('Add1000'); for(var i:int=0;i<1000;i++) { var button:Button=new Button('button-4.png'); button.label='button:'+i; sp.addChild(b...

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

299. 画了一个封闭的曲线,获取鼠标点击处的像素,为何坐标对不上导致拿不到正确位置的Texture? [ 48%]

...000", 15); Laya.stage.addChild(_view); _view.size(80, 100); _view.on(Event.CLICK, this, __clickHandler); } private function __clickHandler():void { trace(_view.stage.mouseX + "---" + _view.stage.mouseY); /*获取所画曲线鼠标点击处的像素,为何坐标对不上?导致无法拿到正确...

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

300. 引擎示例中的新手引导自己写了一次,不知道为什么无法实现点击。 [ 48%]

....height; var bg = new Sprite(); stage.addChild(bg); bg.texture = e; bg.on("click", this, onClick); var guideContainer = new Sprite(); stage.addChild(guideContainer); guideContainer.mouseEnabled = true; guideContainer.cacheAs = "bitmap"; var hitArea = new HitArea(); hitArea.hit.drawRect(0, 0, width, ...

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