Commit 0510b849 authored by wildfirecode13's avatar wildfirecode13

u

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