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

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

221. 怎么给button绑定一个事件,比如console.log一段话 [ 58%]

... 0 分享 微博 QZONE 微信 LT 赞同来自: var btn:Button;btn.on(Event.CLICK, this, onClick); private function onClick():void { console.log(); } 基本就是这个套路加响应事件=。= 官方demo含糊不清的看得累 2018-07-18 0 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回...

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

222. 为什么hitTestPoint始终是false? [ 57%]

...g"); this.s.addChild(img); this.addChild(this.s); Laya.stage.on(Laya.Event.CLICK, this, this.hitPoint); } private hitPoint(e:Laya.Event): void { console.log(this.s.hitTestPoint(e.stageX, e.stageY)); } } 很简单的代码,不知道什么hitTestPoint始终得到的是false.我打印出s的宽高也...

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

223. 可视遮罩层Layer(JavaScript-3D基础(JS)-LayaAir3D之Camera) [ 57%]

...每一次点击切换一个显示层 this.changeActionButton.on(Laya.Event.CLICK, this, function(){ //清除所有图层 this.camera.removeAllLayers(); //计数自加一 this.layerIndex ++; //设置可视图层 this.camera.addLayer(this.layerIndex%4 + 1); //将地板图层加入,地板不参与事...

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

224. 【求助】怎么在自定义对象进行实例化的时候,给它绑定监听事件 [ 57%]

...t); } private function onListRender(food):void{ trace(food); food.on(Event.CLICK,this.test); } private function test():void{ trace("test"); }我换了一种思路,是在实例化Food这个对象的时候,在构造函数里,就绑定事件监听函数。但是生成的JS代码,监听范围是...

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

225. 可视遮罩层Layer(ActionScript-3D基础(AS3)-LayaAir3D之Camera) [ 57%]

...加事件 每一次点击切换一个显示层 changeActionButton.on(Event.CLICK, this, function():void { //清除所有图层 camera.removeAllLayers(); //计数自加一 layerIndex ++; //设置可视图层 camera.addLayer(layerIndex%4 + 1); //将地板图层加入,地板不参与事件 camera.add...

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

226. 可视遮罩层Layer(TypeScript-3D基础(TS)-LayaAir3D之Camera) [ 57%]

...每一次点击切换一个显示层 this.changeActionButton.on(Laya.Event.CLICK, this, function():void { //清除所有图层 this.camera.removeAllLayers(); //计数自加一 this.layerIndex ++; //设置可视图层 this.camera.addLayer(this.layerIndex%4 + 1); //将地板图层加入,地板不参...

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

227. 按照视频教程popup为什么没有底层的透明遮盖层啊? [ 57%]

...遮盖层的,为什么我的就没有啊? this.btn_login.on(Laya.Event.CLICK,null,()=>{   var aDia:aDialog = new aDialog("登陆");   aDia.popup(true);   Laya.stage.addChild(aDia); })   附件 : --> 2017-12-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 ...

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

228. 3D场景跳转到2D场景问题 [ 57%]

...Awake(){ let btnOnce=this.getChildByName("btnOnce"); btnOnce.on(Laya.Event.CLICK,this,this.onClick); } onClick(e){ this.removeSelf(); let gameScene=new GameScene(); Laya.stage.addChild(gameScene); } } 求大佬教学 2019-09-03 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关...

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

229. list item 添加事件后无法监听 [ 57%]

...);     cell.setImg(cell.dataSource[index]);     cell.on(Laya.Event.CLICK, function() {         console.log("click")     }) }  function onSelect(index) {     console.log("当前选择的索引:" + index); } function createAPIList(api_list_view) {     let data = [];   ...

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

230. 按钮交互实现 [ 57%]

...new GameOverUI(); this.SceneMajor.addChild(gameOver); gameOver.btRetry.on('click', this, function(){ window.location.reload(); });当然因为按钮都是小元素, 默认情况下会被打包成atlas文件 需要在代码执行前先下载完毕这个图片集 Laya.loader.create("res/atlas/simbols....

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