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

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

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

...png",0,0,0,0,Laya.Handler.create(this,function() { console.log(sp.width,sp.height); })); Laya.stage.addChild(sp); ``` loadImage在加载完成的回调函数触发之后才可以正确获取宽高。 1. **直接调用size设置:** ```typescript Laya.loader.load("res/apes/monkey2.png",Laya.Handler....

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

232. 写入时,对不上位置 [ 80%]

...17 11:31 @Monica: 还要 加这个Laya.stage.scaleMode = Stage.SCALE_FIXED_HEIGHT; king • 2017-07-17 11:32 @Monica:就有问题了啊, Monica • 2017-07-17 14:41 @king:同事这边没有时间去看这个问题,目前最简单的解决方法就是在舞台下添加个root容器。然后移动...

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

233. 用LayaAir引擎解析Tiled Map地图(ActionScript-2D进阶篇(AS3)-扩展模块) [ 80%]

...nction TiledMapDemo() { //初始化舞台 Laya.init(Browser.width, Browser.height, WebGL); //创建TiledMap实例 tMap = new TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Rectangle = new Rectangle(0, 0, Browser.width, Browser.height); //创建TiledMap地图 tMap.createMap("res/Tile...

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

234. 鼠标穿透问题 [ 80%]

...ngBg = new Sprite(); _loadingBg.graphics.drawRect(0, 0, _list.width, _list.height, "#000000"); _loadingBg.alpha = .7; _loadingBg.size(_list.width, _list.height); _loadingBg.mouseThrough = true; return _loadingBg; } } } import laya.display.Sprite; class RecordItem extends Sprite { public function Rec...

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

235. GlowFilter和TimeLine/Tween一起用的问题 [ 80%]

...WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL);   Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER;   Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628";   Laya.loader.load(apePath, Handler.create(this, setup))...

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

236. 急急急,如何设置按钮点击加载ani [ 80%]

...raphicBounds();             ani.pivot(bounds.width / 2, bounds.height / 2);                          ani.pos(Laya.stage.width / 2, Laya.stage.height / 2);                          Laya.stage.addChild(ani);       } } }     2018-07-25 ...

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

237. Tree属性详解(ActionScript-IDE篇(AS3)-IDE组件属性详解) [ 79%]

...位置 tree.x = (Laya.stage.width - tree.width) / 2; tree.y = (Laya.stage.height - tree.height) / 2; //加载到舞台 Laya.stage.addChild(tree); } } } import laya.ui.Box; import laya.ui.Clip; import laya.ui.Label; // IDE中生成的此类对应的json对象,在此作为参考,对应树形结构...

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

238. 关于缓动函数from的一些问题记录 [ 79%]

...Text(); letterText.text ="hello world"; letterText.width = 400; letterText.height = 200; letterText.fontSize = 36; letterText.align = "center"; letterText.valign = "middle"; var offsetPos={offsetX:100,offsetY:100}; letterText.x = Laya.stage.width - letterText.width>>1 +offsetPos.offsetX; lette...

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

239. 加载-销毁Texture使用的图片资源 [ 79%]

...WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = L...

来源: Laya2.0_示例 发布时间: 20240930

240. 滤镜问题,有复现demo [ 79%]

...*/ Laya.stage.graphics.drawRect(200, 200, Laya.stage.width / 2, Laya.stage.height / 2, "#ffff00"); var btn:Sprite = new Sprite(); btn.size(200, 100); btn.graphics.drawRect(0, 0, btn.width, btn.height, "#ff00ff"); Laya.stage.addChild(btn); btn.on(Event.MOUSE_DOWN, this, function():void { btn.filters ...

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