大约有 1,490 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0057 秒)
Laya_社区(916) Laya2.0_文档(193) Laya_示例(125) Laya2.0_示例(101) Laya3.0_api(79) Laya3.0_文档(72) laya_api(2) Laya2.0_api(2)
...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
...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
... 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
...onsole.log('RunGame Init'); //添加背景 var bg = new Background(); this.addChild(bg); //添加地板集合 var mapFloor = new MapFloor(); this.addChild(mapFloor); } })(); 前期工作都做好了~~ 接下来就是把地板显示到舞台上面 打开Floor.js 我们来给floor设置皮肤 (funct...
来源: Laya_社区 发布时间: 20160728
...悲剧 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
...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
...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
... "#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
...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
...; 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