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

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

161. 鼠标脚本(JavaScript-3D基础(JS)-LayaAir3D之鼠标交互) [ 68%]

...ript export default class MouseScript extends Laya.Script3D{ constructor(){super();} //物体必须拥有碰撞组件(Collider) //当被鼠标点击 onMouseDown(e){ //console.log("点击到了我box",owner.name); //从父容器销毁我自己 this.owner.removeSelf(); } } ``` > **主类**: ```typ...

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

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

...tUI extends ui.test.TestPageUI {      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);     }   ...

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

163. 微信小游戏,实现监听前后台切换 [ 67%]

...helper' export default class welcome extends Laya.Script { constructor() { super() } onEnable() { wxHelper.onShow(this.resumeGame) wxHelper.onHide(this.pauseGame) } resumeGame () { console.log('resumeGame') } pauseGame () { console.log('pauseGame') } onDestroy () { wxHelper.offHide() wxHelper.offSho...

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

164. ProgressBar 代码问题 [ 67%]

...class Onloading extends ui.LoadingUI{        constructor(){        super();        this.loadingBar.changeHandler = new Handler(this, this.onChange); } public changeValue():void{        console.log("change");        if (this.loadingBar.value >= 1){                 this....

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

165. 为什么hitTestPoint始终是false? [ 67%]

...s Laya.Sprite { private s:Laya.Sprite = new Laya.Sprite(); constructor() { super(); var img:Laya.Image = new Laya.Image("comp/bg.png"); 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.hitTe...

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

166. 多重遮罩显示异常 [ 67%]

...如下 export default class ClipView extends Laya.Sprite { constructor() { super(); this.init(); } init() { let bg = new Laya.Sprite(); bg.graphics.drawRect(0, 0, 500, 500, '#aaa'); this.addChild(bg); this.panel = new Laya.Panel(); this.panel.width = 500; this.panel.height = 500; this.panel.vScrollB...

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

167. spine动画放大后,遮罩显示不正常 [ 67%]

...ene文件 export default class GameUI extends Laya.Scene { constructor() { super(); //设置单例的引用方式,方便其他类引用 GameUI.instance = this; //关闭多点触控,否则就无敌了 Laya.MouseManager.multiTouchEnabled = false; //加载场景文件 this.loadScene("test/TestScene...

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

168. 这种进度条怎么实现? [ 67%]

...eSprite: Sprite = new Sprite() public startY: number = -90 constructor() { super() this._init() } private _init() { this.cacheAs = "bitmap" this.size(this.DEF_SIZE,this.DEF_SIZE) this.pos(200,200) this.cacheAs = "bitmap" this.graphics.drawPie(this.DEF_SIZE >> 1, this.DEF_SIZE >> 1, this....

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

169. 刚接触laya的一系列问题 [ 67%]

...延迟两帧以后设置就可以了,用不了button,只能用this和super;

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

170. 为什么这个ui中给这个TextInput组件runtime属性绑定了一个类 [ 67%]

...xtInputEx extends Laya.TextInput constructor() { console.log("执行了"); super() ; } // 获取焦点 onFocus() : void { console.log("焦点进入"); // 是否缓存初始的文本提示字符串和文本颜色. if (!this.initText) { this.initText = this.textField.text ; this.initColor = this.textF...

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