大约有 1,491 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0056 秒)
Laya_社区(917) Laya2.0_文档(193) Laya_示例(125) Laya2.0_示例(101) Laya3.0_api(79) Laya3.0_文档(72) laya_api(2) Laya2.0_api(2)
...toSize = true; redBox.graphics.drawRect(0,0,100,100,'#ff0000'); Laya.stage.addChild(redBox); redBox.on("click",this,function(){ trace("click redbox"); }); redBox.on("mouseover",this,function(){ redBox.graphics.clear(); redBox.graphics.drawRect(0,0,100,100,'#00ff00'); }); redBox.on("mouseout",this,fu...
来源: Laya_社区 发布时间: 20170710
...this._rootSp.hitArea = new Laya.Rectangle(0, 0, 10000, 10000) this._rootSp.addChild(this.firstSp); Laya.stage.addChild(this._rootSp); } private MouseWheel(e: Laya.Event) { let xs = this.firstSp.scaleX; if (e.delta > 0) { xs = xs * 1.2; } else { xs /= 1.2; } this.firstSp.scale(xs, xs); } } new G...
来源: Laya_社区 发布时间: 20190314
...te = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); return ape; } } } new laya.Main(); ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果位图。运行效果如图1所示: ; this.ape.loadImage(ApePath); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(ApePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.x = Laya.stage.width / 2; this.ape.y = Laya.stage.height / 2; this.ape.on(Event.MOUSE_DOWN, this, ...
来源: Laya2.0_示例 发布时间: 20251209
...光 private addLoadCCDLight() { //聚光灯 this.loadCCDlight = this.scene.addChild(new Laya.SpotLight()) as Laya.SpotLight; this.loadCCDlight.color = new Laya.Vector3(1, 1, 1); this.loadCCDlight.transform.position = new Laya.Vector3(-1, 1.2, 0.0); this.loadCCDlight.direction = new Laya.Vector3(0.15...
来源: Laya_社区 发布时间: 20180515
... //imgLove.pos(iRows*this._x + 120 , iColumns*this._y + 320); this.imageBg.addChild(imgLove); } }TypeError: node._setParent is not a function preload.js:55 at Image.__proto.addChild (file:///E:/laya/myLaya/myZootopia/bin/libs/laya.core.js:20925:9) at LoveControl.createLoveArr (file:///E:...
来源: Laya_社区 发布时间: 20190625
...eContainer=new Sprite(); guideContainer.cacheAs = "bitmap"; this.addChild(guideContainer); maskArea = new Sprite(); maskArea.alpha = 0.3; maskArea.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#0ef604"); guideContainer.addChild(maskArea); //EventManager.add(MyEven...
来源: Laya_社区 发布时间: 20171213
...new NormalDialog(context); this.normalDialog.popup(true, true); Laya.stage.addChild(this.normalDialog); } } // 弹窗代码 class NormalDialog extends ui.normalDialogUI { constructor( text: string ) { super(); // 设置label文字 this.context.text = text; this.btn_close.on(Laya.Event.C...
来源: Laya_社区 发布时间: 20181216
...w Sprite(); gameContainer.loadImage("crazy_snowball.png", 0, 0, 600, 400); addChild(gameContainer); // 引导所在容器 guideContainer = new Sprite(); // 设置容器为画布缓存 guideContainer.cacheAs = "bitmap"; addChild(guideContainer); //绘制遮罩区,含透明度,可见游戏背景 v...
来源: Laya_社区 发布时间: 20170315
...; soundButton.y = (Laya.stage.height - soundButton.height) / 2; Laya.stage.addChild(soundButton); //创建一个Sprite充当音乐播放按钮 var musicButton: Sprite = this.createButton("播放音乐"); musicButton.x = soundButton.x + gap + soundButton.width; musicButton.y = soundButton.y; Laya.s...
来源: Laya_社区 发布时间: 20190421