[]dialog的lock属性没出现

dialog的lock属性点不出来,要如何在dialog popup之后锁定窗口不会因为点击dialog后的阴影而回弹?
已邀请:

cuixueying

赞同来自: ethan

你可能设置的顺序不对,可以参考下我下面的例子
package
{
import laya.display.Stage;
import laya.ui.Button;
import laya.ui.Dialog;
import laya.ui.Image;
import laya.utils.Handler;
import laya.webgl.WebGL;

public class DialogCenterClose
{
private const DIALOG_WIDTH:int = 220;
private const DIALOG_HEIGHT:int = 275;
private const CLOSE_BTN_WIDTH:int = 43;
private const CLOSE_BTN_PADDING:int = 5;

private var assets:Array;

public function DialogCenterClose()
{
// 不支持WebGL时自动切换至Canvas
Laya.init(800, 600, WebGL);
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;

Laya.stage.scaleMode = Stage.SCALE_SHOWALL;
Laya.stage.bgColor = "#eeffcc";
UIConfig.closeDialogOnSide=false;//在dialog显示之前提前设置
assets = ["res/ui/dialog (1).png", "res/ui/close.png"];
Laya.loader.load(assets, Handler.create(this, onSkinLoadComplete));
}

private function onSkinLoadComplete(e:*=null):void
{
var dialog:Dialog = new Dialog();
var bg:Image = new Image(assets[0]);
dialog.addChild(bg);
var button:Button = new Button(assets[1]);
button.name = Dialog.CLOSE;
button.pos(DIALOG_WIDTH - CLOSE_BTN_WIDTH - CLOSE_BTN_PADDING, CLOSE_BTN_PADDING);
dialog.addChild(button);
dialog.dragArea = "0,0," + DIALOG_WIDTH + "," + DIALOG_HEIGHT;
dialog.popup();
}
}
}

要回复问题请先

商务合作
商务合作