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

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

231. 请问Laya如果获取Laya.Event.CLICK时间的点击坐标? [ 72%]

...var clickRect = new Laya.Sprite(); clickRect.graphics.drawRect( 0, 0, Laya.stage.width, Laya.stage.height-100 ); clickRect.pos( 0, 0 ); clickRect.size( Laya.stage.width, Laya.stage.height-100 ); Laya.stage.addChild( clickRect ); clickRect.on( Laya.Event.CLICK, this, changeVxVy ); } function changeV...

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

232. 精灵添加名称 [ 72%]

...#eeb9b3");         sp.on(Event.CLICK,this, onsp);         Laya.stage.addChild(sp);   }   private function onsp(e:Event){              console.log("监听到按钮"+e.target);              console.log((e.target.getChildAt(0) as Sprite).name);              console.l...

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

233. 使用音频 · LayaAir3.0文档 · LAYABOX [ 72%]

...要开发者要自行在失去焦点和恢复的时候,通过侦听失去stage焦点和获得stage焦点进行控制,(在小游戏平台,也要看各小游戏的平台切出规则),浏览器中恢复的参考代码如下: …… //循环播放_sound _sound.play(0); //失去舞台焦点...

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

234. 鼠标事件out ,move 发生再up事件之后 [ 72%]

...急,大神帮看哈 关于使用matterjs物理引擎鼠标问题 修改stage的scale后,会发生异常情况 List滑动条会引起单元格上的按钮点击后多次触发点击事件 问题状态 最新活动: 2019-11-22 10:44 浏览: 887 关注: 1 人

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

235. 关于Pivot和Mask联合使用时的显示问题再次提交 [ 72%]

...改为如下: (function() {     var Sprite = Laya.Sprite;     var Stage = Laya.Stage;     var Browser = Laya.Browser;     var Handler = Laya.Handler;     var WebGL = Laya.WebGL;     var maskSp;     var bg2;     (function()     {         // 不支持WebGL时自动...

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

236. 切换后台时,引擎如何判断是否停止定时器? [ 72%]

...      constructor() {         super();          this.stage.on(Laya.Event.FOCUS, this, this.onFocus);         this.stage.on(Laya.Event.BLUR, this, this.onBlur);         Laya.timer.frameLoop(1,this,this.onFrameLoop);     }      private onFrameLoop():void{...

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

237. 学习官方视频教程中飞机大战游戏出现的问题!! [ 72%]

...的问题!! 在鼠标控制飞机移动时,写成this.hero.pos(Laya.stage.mouseX, Laya.stage.mouseY);是没有用的,可以看到hero容器的坐标变化了,但是机身显示还在原地并未移动, 但如果设置this.hero.aniBody.pos(Laya.stage.mouseX, Laya.stage.mouseY), 机身...

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

238. 显示与切换图片(ActionScript-LayaAir基础篇(AS3)-位图) [ 72%]

...in() { //初始化舞台 Laya.init(1334,750); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" var img:Sprite = new Sprite(); //加载显示图片,坐标位于100,50 img.loadImage("res/img/monkey1.png"); //添加到舞台 Laya.stage.addChild(img); } } } ``` 在示例代码里,“`100,50`...

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

239. 关于不同语言中使用适配 [ 72%]

关于不同语言中使用适配 在ActionScript中对Laya.stage.sizeMode的设置 和在TypeScript中对Laya.stage.sizeMode的设置 最终表现出来的效果会不一样,这是对不同语言的不同处理吗?   比如Laya.stage.sizeMode=Stage.SCALE_EXACTFIT 在ActionScript中会根据浏...

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

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

...的触摸点失效,单点的情况下会获得三个触摸点信息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