[LayaAirIDE 1.0]Sprite设置mask属性为什么显示是透明的?怎样才能显示正常?
(function () {
var Sprite = Laya.Sprite;
var Stage = Laya.Stage;
var HitArea = Laya.HitArea;
var WebGL = Laya.WebGL;
var red;
var guideContainer;
var tipContainer;
var hitArea;
var interactionArea;
(function () {
Config.isAlpha = true;//设置画布是否透明,只对2D(WebGL)、3D有效。
Laya.init(1280, 720);
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.bgColor = "none";//背景透明
var gameContainer = new Sprite();
gameContainer.loadImage("gameres/extend/micro/bg.png");
var mask = new Sprite();
mask.alpha = 0.3;
mask.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000");
mask.on(Laya.Event.CLICK,this,chick);
function chick(){
mask.destroy();
gameContainer.destroy();
}
gameContainer.mask=mask;
Laya.stage.addChild(gameContainer);
})();
})();
var Sprite = Laya.Sprite;
var Stage = Laya.Stage;
var HitArea = Laya.HitArea;
var WebGL = Laya.WebGL;
var red;
var guideContainer;
var tipContainer;
var hitArea;
var interactionArea;
(function () {
Config.isAlpha = true;//设置画布是否透明,只对2D(WebGL)、3D有效。
Laya.init(1280, 720);
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.bgColor = "none";//背景透明
var gameContainer = new Sprite();
gameContainer.loadImage("gameres/extend/micro/bg.png");
var mask = new Sprite();
mask.alpha = 0.3;
mask.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000");
mask.on(Laya.Event.CLICK,this,chick);
function chick(){
mask.destroy();
gameContainer.destroy();
}
gameContainer.mask=mask;
Laya.stage.addChild(gameContainer);
})();
})();
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复