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

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

241. 关于graphics镂空的问题https://ask.layabox.com/question/139 [ 85%]

...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

242. 圆环不跟随 sprite 一起缩放? [ 85%]

...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

243. 设置滤镜(TypeScript-LayaAir基础篇(TS)-位图) [ 85%]

...te = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); return ape; } } } new laya.Main(); ``` 在上面的代码中,我们创建了一个原始位图、一个红色滤镜效果位图、一个灰色滤镜效果位图。运行效果如图1所示: ![图1](img/1.pn...

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

244. 鼠标交互-拖动 [ 85%]

...ya.Event; this.ape = new Sprite(); 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

245. layabox 只支持一个灯光? [ 85%]

...光 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

246. 给图片节点添加新创建的图片,会报这个错:node._setParent is not a function [ 85%]

... //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

247. destination-out 叠加模式问题 [ 85%]

...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

248. dialog的popup方法不会关闭其他弹窗 [ 85%]

...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

249. 关于新手引导 [ 85%]

...w Sprite(); gameContainer.loadImage("crazy_snowball.png", 0, 0, 600, 400); addChild(gameContainer); // 引导所在容器 guideContainer = new Sprite(); // 设置容器为画布缓存 guideContainer.cacheAs = "bitmap"; addChild(guideContainer); //绘制遮罩区,含透明度,可见游戏背景 v...

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

250. 版本号:2.0.2 beta, 在sound文件夹下音乐播放不了,放入到res文件夹下可播放 [ 85%]

...; 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