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

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

371. Texture内存回收(ActionScript-2D进阶篇(AS3)-性能优化) [ 65%]

...1000, 800); //显示一个图片 sp = Sprite.fromImage("res/bg.jpg"); Laya.stage.addChild(sp); //显示一个动画 var ani:Animation = new Animation(); ani.loadAtlas("res/fighter.atlas"); ani.play(); ani.pos(400, 200); sp.addChild(ani); Laya.stage.on("keydown", this, onKeyDown); Stat.show(); } priv...

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

372. TimeLine运行的小问题 [ 64%]

...复 cuixueying 赞同来自: //初始化引擎 Laya.init(600, 400); Laya.stage.bgColor="#eeffcc"; var sp:Sprite=new Sprite(); sp.graphics.drawRect(0,0,200,200,"#FF0000"); Laya.stage.addChild(sp); var timeLine:TimeLine=new TimeLine(); timeLine.on(Event.LABEL,this,onLabel); timeLine.addLabel("A",0).to...

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

373. 龙骨skeleton鼠标点击区域的设置 [ 64%]

...例: mArmature = mFactory.buildArmature(1); mArmature.play(0,true); Laya.stage.addChild(mArmature); mArmature.pos(300,600); var rect:Rectangle=new Rectangle(-420,-680,420,680); mArmature.hitArea=rect; mArmature.on(Event.CLICK,this,onClick);    2016-11-22 0 0 分享 微博 QZONE 微信 asdf131 ...

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

374. LayaFlash如何使用chrome调试问题? [ 64%]

...nts.Event; public class Main extends Sprite { public function Main() { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(event:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); IFlash.setSize(960, 640); //2D项目中设置场景尺寸 I...

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

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

...LayaUISample { constructor() { //初始化引擎 Laya.init(600, 400); Laya.stage.bgColor = "#ffcccc"; var data: string = "data:image/svg+xml," + '' + '' + '' + 'I like ' + '' + 'cheese' + '' + '' + ''; var sp: Laya.Sprite = new Laya.Sprite(); sp.loadImage(data, 0, 0, 200, 200); Laya.stage.addChild(s...

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

376. Laya.loader.load 教程代码出错 [ 64%]

...oadComplated(e:*=null):void         {             Laya.stage.addChild(img);             img.on("click",this,OnImgClick);             OnImgClick();                          var txt:Text = new Text();             txt.text ...

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

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

...aya.Loader.ATLAS); } private onLoaded():void{ this.ball = new Ball(); Laya.stage.addChild(this.ball); this.ball.x = Laya.stage.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():v...

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

378. localToGlobal获取坐标总是错误! [ 64%]

... localToGlobal获取蓝色小块的全局坐标,将粉色小块添加到Stage里面,然后设置小块的全局坐标,总是对不上,不知道是否是我代码的问题,附件有DEMO工程 let buttonTest = this.getChildByName("buttonTest"); this.sprteCenter = this.getChildByName("sprteC...

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

379. 移动端横竖屏适配(类似锁屏效果)? [ 64%]

...设置初始化 Laya.init(fillWidth,fillHeight); //设置横屏显示 Laya.stage.screenMode="horizontal"; //默认触发一次横竖屏设置 onResize(); //添加RESIZE事件,当舞台发生改变时触发横竖屏设置 Laya.stage.on(Event.RESIZE,this,onResize); } private function onResize():void...

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

380. 打包淘宝小程序后,大部分手机无法打开,模型也无法居中 [ 64%]

... 提交 1 个回复 陆仁毅 赞同来自: 再Laya.init之后设置 Laya.stage.useRetinalCanvas = false;或者注释掉 laya.tbmini.js 里 Config.useRetinalCanvas = true 相关代码,再选择合适的适配模式。老版本的淘宝适配库需要配合注释掉 laya.tbmini.js 里 以下监听...

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