From 1822f2dc2ddcf398a009f31e179e46c211abf323 Mon Sep 17 00:00:00 2001 From: leo <907600065@qq.com> Date: Fri, 12 Jul 2019 15:41:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=92=99=E6=9D=BF=E7=9A=84component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CreatorUtils/UI/MaskLayer.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 CreatorUtils/UI/MaskLayer.js diff --git a/CreatorUtils/UI/MaskLayer.js b/CreatorUtils/UI/MaskLayer.js new file mode 100644 index 0000000..567177c --- /dev/null +++ b/CreatorUtils/UI/MaskLayer.js @@ -0,0 +1,25 @@ +cc.Class({ + extends: cc.Component, + + properties: { + isBlockInput: true, + }, + + // LIFE-CYCLE CALLBACKS: + + onLoad() { + //获取运行场景的可见大小。 + let visiSize = cc.view.getVisibleSize(); + this.node.width = visiSize.width; + this.node.height = visiSize.height; + this.node.color = cc.hexToColor('#000000'); + this.node.opacity = 150; + if (this.isBlockInput) { + this.node.addComponent(cc.BlockInputEvents); + } + }, + + start() {}, + + // update (dt) {}, +}); \ No newline at end of file