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
501f13de
Commit
501f13de
authored
Aug 13, 2021
by
shunx 马
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'disu0811' of gitlab2.dui88.com:wildfirecode13/wfc13 into disu0811
parents
29e7b501
f4eb2abe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
ShareMask.ts
project/src/common/ShareMask.ts
+53
-0
createMask.ts
project/src/common/createMask.ts
+4
-2
No files found.
project/src/common/ShareMask.ts
0 → 100644
View file @
501f13de
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
project/src/common/createMask.ts
View file @
501f13de
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
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