Commit 501f13de authored by shunx 马's avatar shunx 马

Merge branch 'disu0811' of gitlab2.dui88.com:wildfirecode13/wfc13 into disu0811

parents 29e7b501 f4eb2abe
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
export const createMask = (w, h,r, p) => {
export const createMask = (w, h,r, p,color?,alpha?) => {
const m = new FYGE.Shape();
m.beginFill(1, 1);
m.beginFill(color||1, alpha||0);
m.drawRoundedRect(0, 0, w, h,r,r,r,r);
m.endFill();
p && p.addChild(m);
m.width=w;
m.height=h;
return m
}
\ 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