Commit f4eb2abe authored by wildfirecode13's avatar wildfirecode13

u

parent c47dc3f1
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import centerTextField from "./centerTextField";
let mask;
export default class ShareMask extends FYGE.Sprite {
constructor(color = 0, alpha = .7, container?) {
super();
const bg = new FYGE.Shape();
bg.beginFill(color, alpha);
bg.drawRect(0, 0, 750, 1624);
bg.endFill();
this.addChild(bg);
// this.addChild(new TestLabel({
// text:'这是个分享引导蒙层',
// color:'0xffffff',w:750,h:1624
// }));
if (container)
container.addChild(this);
let callback;
callback = () => {
this.parent && this.parent.removeChild(this);
this.removeEventListener(FYGE.MouseEvent.CLICK, callback, this);
mask=null;
};
const sharepicWrapper = new FYGE.Sprite();
const pic = sharepicWrapper.addChild(new FYGE.Sprite(RES.getRes('sharemask.png')));
const gap = 30;
sharepicWrapper.x = 750-pic.width-gap;
sharepicWrapper.y = gap;
this.addChild(sharepicWrapper);
this.addEventListener(FYGE.MouseEvent.CLICK, callback, this);
}
}
export const showShareMask = ()=>{
if(mask)return;
mask = new ShareMask();
layers.shareLayer.addChild(mask);
}
export const hideShareMask = ()=>{
if(!mask) return;
layers.shareLayer.removeChild(mask);
mask=null;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment