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

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

161. 屏幕适配-缩放-Extract Fit [ 88%]

...Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale...

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

162. 骨骼动画-适配版Spine [ 88%]

...parseComplete() { this.skeleton = this.templet.buildArmature(); Laya.stage.addChild(this.skeleton); this.skeleton.pos(Browser.width / 2, Browser.height / 2 + 100); this.skeleton.scale(0.5, 0.5); this.skeleton.on(Event.STOPPED, this, this.play); this.play(); } onError() { console.log("parse error"); ...

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

163. ???????? 为啥加一个 Text,drawcall 暴增? [ 88%]

... fish.scoreItem.y = fish.getBox().y - fish.scoreItem.height; this.scoreBox.addChild(fish.scoreItem); fish.scoreGold = new Laya.Image(); fish.scoreGold.skin = "assets/ui_imgs/icon_00312.png"; fish.scoreGold.x = fish.scoreItem.x; fish.scoreGold.y = fish.scoreItem.y; fish.scoreGold.scaleX = 0.6; fish.s...

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

164. 【简单跑酷--JS版】---Lv.3 添加地板 [ 88%]

...onsole.log('RunGame Init'); //添加背景 var bg = new Background(); this.addChild(bg); //添加地板集合 var mapFloor = new MapFloor(); this.addChild(mapFloor); } })(); 前期工作都做好了~~ 接下来就是把地板显示到舞台上面 打开Floor.js 我们来给floor设置皮肤  (funct...

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

165. 为什么会出现报错 ani not found:ufo1_down [ 88%]

...悲剧 this.bg = new BackGround(); // 把背景添加到舞台 Laya.stage.addChild(this.bg); // 加载图集资源 Laya.loader.load("res/atlas/war.json",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS); })(); function onLoaded(){ // 创建一个主角 this.hero = new Role(); // 初始化...

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

166. Sprite-显示图片 [ 88%]

...png"; // 方法1:使用loadImage let ape = new Laya.Sprite(); Laya.stage.addChild(ape); ape.loadImage(monkey1Path); // 方法2:使用drawTexture Laya.loader.load(monkey2Path, Laya.Handler.create(this, function () { let monkey2 = Laya.loader.getRes(monkey2Path); let ape2 = new Laya.Sprite(); Laya...

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

167. List中放TextInput,当list滚动的时候,复用会有问题,input中的内容会乱,尤其有输入框focus的情况下 [ 88%]

...Item.__super.call(this); this.size(WID, HEI); this.img = new Image(); this.addChild(this.img); this.img.graphics.drawRect(0, 0, WID, HEI - 2, "#eeeeee"); this.label = new Label(); this.addChild(this.label); this.input = new TextInput(); this.addChild(this.input); this.input.x = 50; this.input.text =...

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

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

... "#FF0000"); var bounds:Rectangle  = sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` ​ getBounds可以满足多数多数需求,但由于其需要计算边界,不适合频繁调用。 2. 设置容器的autoSize为true。 ```javascript var sp:Sprite = new Sprite(); sp.autoSize = tr...

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

169. timer.loop帧率高于物理帧率移动父级导致子物体本地坐标异常 [ 88%]

...ME_SLOW;         Laya.Stat.show();         this.scene = Laya.stage.addChild(new Laya.Scene3D());                  Laya.timer.loop(1, this, this.loopfun);     }     loopfun(){         this.lastT = Date.now();         let dis = 1;         if(!this.cubeP){         ...

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

170. UI-ProgressBar [ 88%]

...; this.progressBar = new ProgressBar("res/ui/progressBar.png"); Laya.stage.addChild(this.progressBar); this.progressBar.width = 400; this.progressBar.x = (Laya.stage.width - this.progressBar.width ) / 2; this.progressBar.y = Laya.stage.height / 2; this.progressBar.sizeGrid = "5,5,5,5"; this.progress...

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