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

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

1. CPU优化方式(ActionScript-2D进阶篇(AS3)-性能优化) [ 100%]

...要知道。 1. 使用getBounds/ getGraphicBounds。 ```javascript var sp:Sprite = new Sprite(); sp.graphics.drawRect(0, 0, 100, 100, "#FF0000"); var bounds:Rectangle  = sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` ​ getBounds可以满足多数多数需求,但由于其需要计...

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

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

...。 1. 使用getBounds/ getGraphicBounds。 ```javascript var sp=new Laya.Sprite(); sp.graphics.drawRect(0,0,100,100,"#FF0000"); var bounds:Laya.Rectangle=sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` getBounds可以满足多数多数需求,但由于其需要计算边界,不适合频繁调...

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

3. 内存优化方式(ActionScript-2D进阶篇(AS3)-性能优化) [ 95%]

...对象回收至对象池内。 ```javascript package { import laya.display.Sprite; import laya.display.Stage; import laya.ui.Image; import laya.utils.Pool; import laya.webgl.WebGL; public class PoolTest { //创建新对象的时间 private var createTime:int=0; public function PoolTest() { //初始...

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

4. 资源加载(ActionScript-3D基础(AS3)-LayaAir3D之资源加载) [ 93%]

....create(null, function(tex:Texture2D):void { //使用纹理 var earth1:MeshSprite3D = scene.addChild(new MeshSprite3D(PrimitiveMesh.createSphere(5, 32, 32))) as MeshSprite3D; earth1.transform.translate(new Vector3(10, 20, -8)); var earthMat:BlinnPhongMaterial = new BlinnPhongMaterial(); earthMat.alb...

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

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

...。 1. 使用getBounds/ getGraphicBounds。 ```typescript var sp=new Laya.Sprite(); sp.graphics.drawRect(0,0,100,100,"#FF0000"); var bounds:Laya.Rectangle=sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` getBounds可以满足多数多数需求,但由于其需要计算边界,不适合频繁调...

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

6. 资源加载(TypeScript-3D基础(TS)-LayaAir3D之资源加载) [ 88%]

...l, function(tex) { //使用纹理 var earth1 = scene.addChild(new Laya.MeshSprite3D(PrimitiveMesh.createSphere(5, 32, 32))); earth1.transform.translate(new Laya.Vector3(10, 20, -8)); var earthMat = new Laya.BlinnPhongMaterial(); earthMat.albedoTexture = tex; earthMat.albedoIntensity = 1; earth1.mesh...

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

7. 资源加载(JavaScript-3D基础(JS)-LayaAir3D之资源加载) [ 87%]

...l, function(tex) { //使用纹理 var earth1 = scene.addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createSphere(5, 32, 32))); earth1.transform.translate(new Laya.Vector3(10, 20, -8)); var earthMat = new Laya.BlinnPhongMaterial(); earthMat.albedoTexture = tex; earthMat.albedoIntensity = 1; earth1...

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

8. 内存优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 86%]

...保一个对象能够被回收,需要删除对该对象的所有引用。Sprite提供的`destory()`方法会帮助设置内部引用为null。 例如,以下代码确保对象能够被作为垃圾回收: 1. `//创建一个Sprite实例` 2. `var sp:Laya.Sprite = new Laya.Sprite();` 3. `//将sp内...

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

9. 内存优化方式(JavaScript-2D进阶篇(JS)-性能优化) [ 85%]

...保一个对象能够被回收,需要删除对该对象的所有引用。Sprite提供的`destory()`方法会帮助设置内部引用为null。 例如,以下代码确保对象能够被作为垃圾回收: 1. `//创建一个Sprite实例` 2. `var sp = new Laya.Sprite();` 3. `//将sp内部引用设...

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

10. 二进制图片(ActionScript-2D进阶篇(AS3)-游戏加载策略) [ 83%]

...个Laya的AS项目,代码如下: ```java package { import laya.display.Sprite; import laya.events.Event; import laya.net.HttpRequest; import laya.utils.Browser; public class LayaSample { public function LayaSample() { //初始化引擎 Laya.init(1136, 640); var sp:Sprite = new Sprite(); var xhr:...

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