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

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

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

...存 用IDE新建一个项目var WebGL = laya.webgl.WebGL; Laya.init(600, 400, WebGL); 此时用chrome工具看到 占用内存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 = '...

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

22. 文本对齐与自动换行(ActionScript-LayaAir基础篇(AS3)-文本) [ 85%]

...本区背景 txt.bgColor = "#c30c30"; //设置文本的宽高 txt.width = 400; txt.height = 400; //设置文本水平居中 txt.align = "center"; //设置文本垂直居中 txt.valign = "middle"; Laya.stage.addChild(txt); } } } ``` ![5](img/5.png) 在实际编码中如果需要其他的对齐模式...

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

23. 如何旋转2d的物理系统的矩形 [ 84%]

...ew Sprite(); Laya.stage.addChild(Wall_TL); Wall_TL.graphics.drawRect(0, 0, 400, 32, "#ffff00"); Wall_TL.pivot(200, 16);   var Collision_Wall_TL:any = Matter.Bodies.rectangle(200, 400, 400, 32, { layaSprite:Wall_TL,isStatic: true })  Matter.World.add(this.engine.world, [ Collision_Wall_TL, // Colli...

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

24. 渲染性能实例问题 [ 83%]

...addChild 应该怎么做的呢?Sprite 不可以addChild. Laya.init(550,400,Laya.WebGL);Laya.Stat.show();var textBox = new Laya.Sprite();for(var i=0;i<10000;i++){txt=new Text();txt.text=(Math.random()*100).toFixed(0);txt.color="#CCCCCC";txt.x=Math.random()*550;txt.y=Math.random()*400;textBox.add...

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

25. 文本对齐与自动换行(TypeScript-LayaAir基础篇(TS)-文本) [ 83%]

...本区背景 txt.bgColor = "#c30c30"; //设置文本的宽高 txt.width = 400; txt.height = 400; //设置文本水平居中 txt.align = "center"; //设置文本垂直居中 txt.valign = "middle"; Laya.stage.addChild(txt); } } } new laya.HelloLayabox(); ``` ![5](img/5.png) 在实际编码中如果需...

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

26. putimagedata 不起作用 [ 82%]

... + 2 + d * 4] } } Laya.Browser.context.putImageData(imageData, 0, 0, 0, 0, 400, 400) } function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); // 方法2:使用drawTexture Laya.loader.load("../../res/apes/monk...

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

27. 分享:使用 Chart.js 创建图标 [ 82%]

...class FormDemo { public function FormDemo() { // 初始化舞台 Laya.init(400,400); // 图标数据 var data:Object = { labels: [ //最上方矩形的标签提示和颜色设置 "Red", "Blue", "Yellow" ], datasets: [ { data: [300, 50, 100],//所占整个扇形的比率,以及分割份数 backgrou...

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

28. 屏幕适配-缩放-No Scale [ 82%]

...aya.Sprite; var Stage = Laya.Stage; var rect; (function() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; createCantralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage...

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

29. 屏幕适配-缩放-No Border [ 82%]

...aya.Sprite; var Stage = Laya.Stage; var rect; (function() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NOBORDER; Laya.stage.bgColor = "#232628"; createCantralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stag...

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

30. 屏幕适配-缩放-Show All [ 82%]

...aya.Sprite; var Stage = Laya.Stage; var rect; (function() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; createCantralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage...

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