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

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

441. 分享:DrawToCanvas内存释放问题! [ 44%]

...Canvas命令按钮 var btnDraw:Sprite=CreateBtn(100,400); btnDraw.on(Event.CLICK,this,onClickBtnDraw); } //创建按钮 private function CreateBtn(xx:int,yy:int):Sprite { var btn:Sprite=new Sprite(); btn.graphics.drawRect(0,0,200,50,"#FF0000"); btn.pos(100,400); var text:Text=new Text(); text.text="...

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

442. [LayaAir2]在使用videoDom创建视频元素后iPad跟iPhone中位置不一样 [ 43%]

...eoDom { htmlvideo:Laya.HtmlVideo; constructor() { Laya.stage.on(Laya.Event.CLICK,this,this.onClick); } onClick(){ this.initVideo(); } initVideo() { this.htmlvideo = new Laya.HtmlVideo(); this.htmlvideo.setSource("https://www.layaair.com/3.x/de ... ot%3B,1); this.htmlvideo.video.addEventListener("loa...

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

443. [LayaAir3]Laya 2.x/3.x 演示项目中 Laya.timer.scale 和 Laya.SpineSkeleton.playbackRate 对部分骨骼加速不生效 [ 43%]

...i.playbackRate(10); //侦听点击,换动画 this.spineBtn.on(Laya.Event.CLICK, this, this.changeAni); }第二,你通过Laya.timer.scale设置比较大的值,受限制是因为引擎中作了一些优化保护,让动画不至于播放过快。如果你想自己控制速度,我们也可以...

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

444. 使用对象池重复使用skeleton报错,请问有解决方案吗?谢谢 [ 43%]

...or() { trace("error"); }   function parseComplete() { Laya.stage.on(Event.CLICK, this, () => {     mArmature = Laya.Pool.getItemByClass('Skeleton', Laya.Skeleton);     mArmature.init(mFactory, 1);     mArmature.x = mStartX; mArmature.y = mStartY; mArmature.scale(0.5, 0.5); mArmature.on(Eve...

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

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

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

446. Clip属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 42%]

...FFFFFF,#FFFFFF,#FFFFFF"; this.controller.size(84, 30); this.controller.on('click', this, this.onClipSwitchState); this.controller.x = (Laya.stage.width - this.controller.width) / 2; this.controller.y = (Laya.stage.height - this.controller.height) / 2 + 110; Laya.stage.addChild(this.controller); } pr...

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

447. 弹窗视图组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 42%]

... extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.close(); }); } } 1.3.3 关联场景 设置好弹窗之后,需要用代码将Dialog与所需要用到该Dialog的场景管关联起来。回到初始场景Scene,在Scene2D的属性设置面板...

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

448. 淘宝创意互动分包指南(TypeScript-小游戏适配文档-淘宝创意互动) [ 42%]

...载分包和资源 ``` onConfigLoaded(): void { Laya.stage.on(Laya.Event.CLICK, this, this.toPage2) } toPage2(): void { my.redirectTo({ url: "/subpackage1/page2/index", success: function () { console.log("success") }, fail: function (err) { console.log("2222", err) } }) } ``` 注意:在加载资...

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

449. 请大家帮助优化一下这个抛物线的代码 [ 42%]

...e.width / 2; this.ball.y = Laya.stage.height / 2; Laya.stage.on(Laya.Event.CLICK,this,this.onClick); Laya.timer.frameLoop(1,this,this.onEnterFrame); } private onEnterFrame():void{ if(this.points.length>0){ if(this.i<this.points.length){ this.ball.x = this.points[this.i].x; this.ball.y = this.p...

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

450. LayaAir和原生DOM交互(JavaScript-2D进阶篇(JS)-扩展模块) [ 41%]

...r url = "http://layabox.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,clickHandler); this.qrcodeSp = new Laya.Sprite(); Laya.stage.addChild(this.qrcodeSp); function clickHandler(){ var url = this.qrcode._oDrawing._elImage.src;//获取,注意这里是异步的,开发者可以加...

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