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

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

1. 如何完全删除精灵 并回收内存 [ 100%]

...内存6.4mbvar WebGL = laya.webgl.WebGL; Laya.init(600, 400, WebGL); let container = new Laya.Box() for(let i =0;i<1000;i++){ let t = new Laya.Text() t.text = 'test' t.color = '#ffffff' container.addChild(t) } Laya.stage.addChild(container)新建一个精灵 向其中插入1000个文字 内存快...

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

2. Sprite-容器 [ 98%]

...ript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_Container { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stag...

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

3. Sprite-容器 [ 93%]

...ort Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_Container { // 该容器用于装载4张猩猩图片 private apesCtn: Sprite; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.AL...

来源: Laya_示例 发布时间: 20251130

4. 加了两个遮罩后的动画,帧频只有10了,有demo,有项目,有源码 [ 91%]

...n{ constructor() { Laya.init(1920,950,Laya.WebGL); Laya.Stat.show(); const container = new Laya.Sprite(); Laya.stage.addChild(container); const mask = new Laya.Sprite(); mask.graphics.drawPoly(0, 0, [0, 0, 484, 0, 1483, 950, 0, 950], '#ff0000'); // container.addChild(mask); container.mask = mask; co...

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

5. 鼠标穿透问题 [ 89%]

...ell); cell.addChild(_items[index]); } protected function removeAllChildren(container:Sprite):void { while(container.numChildren > 0) { container.removeChildAt(0); } } protected function createLoading():Sprite { _loadingBg = new Sprite(); _loadingBg.graphics.drawRect(0, 0, _list.width, _list.heigh...

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

6. LayaNative2.0 UI移除舞台,再添加必然无法显示 [ 88%]

....once(2000, this, ShowHide); }   【native2.0中】stage上加几个平级container,然后再同一container上加两个ui,移除舞台后再加上必然无法显示 网页中是正常的   注意:直接加到舞台stage上能正常显示,加到几个平级container中的其中一个就必...

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

7. 浏览器接口 · LayaAir3.3 · 引擎文档 · LAYABOX [ 87%]

...备像素比三、调用原生对象3.1 document Dom3.2 window 窗口3.3 container 画布四、判断运行环境浏览器接口 一、概述 在项目开发中,往往我们需要跟外部运行环境打交道,比如在浏览器运行或者在一些小游戏平台中运行,都需要获取设...

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

8. 关于web端,canvas被删除了以后.无法重新初始化 [ 86%]

...被删除了以后.无法重新初始化 可以把已经存在ls.Browser.container 拿去替换掉当前的容器元素,清屏就可以继续使用 if (ls.Browser.container) { const container = document.getElementById('b-layabox') container.parentNode.replaceChild(ls.Browser.container, container) ...

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

9. hitArea怎么用 [ 86%]

hitArea怎么用 var container = new Sprite();         container.graphics.drawRect(0,0,640,1136,'#ff0000');         container.size(640,1136)         Laya.stage.addChild(container);                       var bg2Sprite =  new Sprite();         bg2Sprite.graphics.drawRect(...

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

10. 物理引擎-牛顿摆 [ 84%]

...tter.Engine.run(engine); var render = LayaRender.create( { engine: engine, container: gameWorld, width: stageWidth, height: stageHeight, options: { wireframes: false } }); LayaRender.run(render); mouseConstraint = Matter.MouseConstraint.create(engine, { element: Render.canvas }); Matter.World.add(en...

来源: Laya_示例 发布时间: 20251130