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

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

441. CPU优化方式(JavaScript-2D进阶篇(JS)-性能优化) [ 40%]

...cript Laya.timer.frameLoop(1, this, animateFrameRateBased); Laya.stage.on("click", this, dispose); function dispose() { Laya.timer.clear(this, animateFrameRateBased); } ``` 当一个对象的生命周期结束时,记得清除其内部的Timer: ### **三、获取显示对象边界的做法** 在...

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

442. LayaAir和原生DOM交互(TypeScript-2D进阶篇(TS)-扩展模块) [ 40%]

...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); } private clickHandler():void{ var url:string = this.qrcode._oDrawing._elImage.src;//获取,注意这里是异步的,...

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

443. drawTexture 画出来的数据会有以前的数据 [ 39%]

...pr.width = 1280; iconSpr.height = 640; iconSpr.addChild(img); btn.on(Event.CLICK,this,runGame1); } private function runGame1():void { xNum = Math.random()*7 - 3; yNum = Math.random()*7 - 3; Laya.timer.loop(20,this,onRun); Laya.timer.frameLoop(10,this,refresh); } private function refresh():void { Ico...

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

444. 如何实现3d遮罩效果? [ 39%]

...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

445. 针对2.0.0 beta5 setLoadingPage 做增强 [ 38%]

...ew LoadPage() loadPage.preload() this.getChildByName('text').on(Laya.Event.CLICK, this, function () { // 切换打开场景方式 查看效果不同 loadPage.openScene('page2.scene', this.getUserInfo, true, [1, 2, 3]) // loadPage.openScene2('page2.scene', this.getUserInfo, true, [1, 2, 3]) }) } /** ...

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

446. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 38%]

... Laya.timer.frameLoop(1, this, this.animateFrameRateBased); Laya.stage.on("click", this, this.dispose); dispose() { Laya.timer.clear(this, this.animateFrameRateBased); } ``` 当一个对象的生命周期结束时,记得清除其内部的Timer: ### **三、获取显示对象边界的做法** 在...

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

447. LAYABOX游戏实时语音之APP版本 [ 38%]

...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

448. 获取位置信息 · LayaAir3.0文档 · LAYABOX [ 37%]

...rt class NewScript extends Laya.Script { constructor() { super(); } onMouseClick(evt: Laya.Event): void { // 尝试获取当前位置 Laya.Geolocation.getCurrentPosition( Laya.Handler.create(this, this.onSuccess), Laya.Handler.create(this, this.onError) ); console.log("click"); } // 成功获取位...

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

449. laya.ui.Button [ 36%]

...的垂直方向中心线的距离(以像素为单位)。 Component  clickHandler : Handler 对象的点击事件处理器函数(无默认参数)。 Button comXml : Object XML 数据。 Component customRenderEnable : Boolean[write-only] 设置是否开启自定义渲染,只有开启自...

来源: laya_api 发布时间: 20170929

450. laya.display.Sprite_API3.0 [ 36%]

...ild(sprite);//将此 sprite 对象添加到显示列表。 sprite.on(Event.CLICK, this, onClickSprite);//给 sprite 对象添加点击事件侦听。 shape = new Sprite();//创建一个 Sprite 类的实例对象 sprite 。 shape.graphics.drawRect(0, 0, 100, 100, "#ccff00", "#ff0000", 2);//绘制一...

来源: Laya3.0_api 发布时间: 20231115