Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
wfc13
Commits
f4eb2abe
Commit
f4eb2abe
authored
Aug 13, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
c47dc3f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
ShareMask.ts
project/src/common/ShareMask.ts
+53
-0
No files found.
project/src/common/ShareMask.ts
0 → 100644
View file @
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment