Commit 0510b849 authored by wildfirecode13's avatar wildfirecode13

u

parent 2e45c9c9
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import centerTextField from "./centerTextField";
import { getStageHeight } from "./stage";
let mask;
export default class ShareMask extends FYGE.Sprite {
......@@ -25,15 +26,15 @@ export default class ShareMask extends FYGE.Sprite {
callback = () => {
this.parent && this.parent.removeChild(this);
this.removeEventListener(FYGE.MouseEvent.CLICK, callback, this);
mask=null;
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;
sharepicWrapper.x = 750 - pic.width - gap;
sharepicWrapper.y = (1624 - getStageHeight()) + gap;
this.addChild(sharepicWrapper);
this.addEventListener(FYGE.MouseEvent.CLICK, callback, this);
......@@ -41,13 +42,13 @@ export default class ShareMask extends FYGE.Sprite {
}
export const showShareMask = ()=>{
if(mask)return;
export const showShareMask = () => {
if (mask) return;
mask = new ShareMask();
layers.shareLayer.addChild(mask);
}
export const hideShareMask = ()=>{
if(!mask) return;
export const hideShareMask = () => {
if (!mask) return;
layers.shareLayer.removeChild(mask);
mask=null;
mask = null;
}
\ No newline at end of file
import { layers } from "../../module/views/layers"
export const getStageWidth = () => { return layers.stage.viewRect.width }
export const getStageHeight = () => { return layers.stage.viewRect.height }
export const getStageOffset = () => { return (1624 - getStageHeight()) / 2 }
\ 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