Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DF-L223
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
DF-L223
Commits
bbb4c9be
Commit
bbb4c9be
authored
Apr 06, 2020
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
a33af498
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
24 deletions
+53
-24
play.component.ts
src/app/play/play.component.ts
+53
-24
petal_10.png
src/assets/play/petal_10.png
+0
-0
petal_12.png
src/assets/play/petal_12.png
+0
-0
petal_5.png
src/assets/play/petal_5.png
+0
-0
petal_8.png
src/assets/play/petal_8.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
bbb4c9be
...
@@ -1021,7 +1021,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1021,7 +1021,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//小珠
//小珠
const
droplet
=
new
MySprite
();
const
droplet
=
new
MySprite
();
droplet
.
setScaleXY
(
this
.
mapScale
);
droplet
.
setScaleXY
(
0.1
);
droplet
.
init
(
this
.
images
.
get
(
"
droplet
"
));
droplet
.
init
(
this
.
images
.
get
(
"
droplet
"
));
droplet
.
alpha
=
0
;
droplet
.
alpha
=
0
;
droplet
.
x
=
x
;
droplet
.
x
=
x
;
...
@@ -1097,7 +1097,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1097,7 +1097,7 @@ export class PlayComponent implements OnInit, OnDestroy {
content_val
.
textAlign
=
'
middle
'
;
content_val
.
textAlign
=
'
middle
'
;
content_val
.
fontSize
=
50
;
content_val
.
fontSize
=
50
;
content_val
.
fontName
=
"
BRLNSDB
"
;
content_val
.
fontName
=
"
BRLNSDB
"
;
content_val
.
fontColor
=
"
#
FFFFFF
"
;
content_val
.
fontColor
=
"
#
006400
"
;
content_val
.
alpha
=
0
;
content_val
.
alpha
=
0
;
content_val
.
refreshSize
();
content_val
.
refreshSize
();
...
@@ -1109,6 +1109,22 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1109,6 +1109,22 @@ export class PlayComponent implements OnInit, OnDestroy {
content_val
.
x
=
-
content_val
.
getBoundingBox
().
width
/
2
;
content_val
.
x
=
-
content_val
.
getBoundingBox
().
width
/
2
;
content_val
.
y
=
-
20
*
this
.
mapScale
;
content_val
.
y
=
-
20
*
this
.
mapScale
;
//字中字效果
{
let
content_val_2
=
new
Label
();
content_val_2
.
text
=
content
.
val
;
content_val_2
.
textAlign
=
'
middle
'
;
content_val_2
.
fontSize
=
content_val
.
fontSize
-
4
;
content_val_2
.
fontName
=
"
BRLNSDB
"
;
content_val_2
.
fontColor
=
"
#FFFFFF
"
;
content_val_2
.
alpha
=
0
;
content_val_2
.
refreshSize
();
content_val_2
.
x
=
(
content_val
.
getBoundingBox
().
width
-
content_val_2
.
getBoundingBox
().
width
)
/
2
;
//content_val_2.y = (content_val.getBoundingBox().height - content_val_2.getBoundingBox().height ) / 2;
content_val
.
addChild
(
content_val_2
);
content_val
.
childDepandAlpha
=
true
;
}
lotusLeafObj
.
conText
=
content_val
;
lotusLeafObj
.
conText
=
content_val
;
parItem
.
addChild
(
content_val
);
parItem
.
addChild
(
content_val
);
...
@@ -1397,7 +1413,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1397,7 +1413,7 @@ export class PlayComponent implements OnInit, OnDestroy {
star
.
init
(
this
.
images
.
get
(
'
star
'
));
star
.
init
(
this
.
images
.
get
(
'
star
'
));
const
randomS
=
(
Math
.
random
()
*
1.5
+
0.5
)
*
this
.
mapScale
;
const
randomS
=
(
Math
.
random
()
*
0.5
+
0.3
)
*
this
.
mapScale
;
star
.
setScaleXY
(
randomS
);
star
.
setScaleXY
(
randomS
);
const
randomR
=
Math
.
random
()
*
360
;
const
randomR
=
Math
.
random
()
*
360
;
...
@@ -1435,7 +1451,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1435,7 +1451,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
lotusLeaf
=
this
.
smallLotusLeafs
[
i
];
let
lotusLeaf
=
this
.
smallLotusLeafs
[
i
];
//显示小水珠
//显示小水珠
lotusLeaf
.
droplet
.
alpha
=
1
;
//
lotusLeaf.droplet.alpha = 1;
//显示内容
//显示内容
let
content
;
let
content
;
...
@@ -1451,7 +1467,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1451,7 +1467,7 @@ export class PlayComponent implements OnInit, OnDestroy {
tweenChange
(
content
,
{
alpha
:
1
},
0.5
,
()
=>
{
tweenChange
(
content
,
{
alpha
:
1
},
0.5
,
()
=>
{
//隐藏小水珠
//隐藏小水珠
lotusLeaf
.
droplet
.
alpha
=
0
;
//
lotusLeaf.droplet.alpha = 0;
});
});
...
@@ -1463,20 +1479,25 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1463,20 +1479,25 @@ export class PlayComponent implements OnInit, OnDestroy {
tweenChange
(
lotusLeaf
.
hl
,
{
alpha
:
0
},
0.5
,
()
=>
{
tweenChange
(
lotusLeaf
.
hl
,
{
alpha
:
0
},
0.5
,
()
=>
{
//显示水珠
//显示水珠
lotusLeaf
.
droplet
.
alpha
=
1
;
//
lotusLeaf.droplet.alpha = 1;
//最后一次,显示大荷叶
if
(
i
==
this
.
smallLotusLeafs
.
length
-
1
){
//显示大荷叶
showBigLotus
();
}
});
});
//隐藏内容
//隐藏内容
tweenChange
(
content
,
{
alpha
:
0
},
0.5
,
()
=>
{
tweenChange
(
content
,
{
alpha
:
0
},
0.5
,
()
=>
{
});
});
//最后一次,显示大荷叶
if
(
i
==
this
.
smallLotusLeafs
.
length
-
1
){
//显示大荷叶
showBigLotus
();
}
//显示小水珠
tweenChange
(
lotusLeaf
.
droplet
,
{
alpha
:
1
,
scaleX
:
this
.
mapScale
,
scaleY
:
this
.
mapScale
},
0.5
)
},
3000
);
},
3000
);
});
});
...
@@ -1485,7 +1506,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1485,7 +1506,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//显示荷叶
//显示荷叶
const
showBigLotus
=
()
=>
{
const
showBigLotus
=
()
=>
{
tweenChange
(
this
.
bigLotusLeaf
.
lotusLeaf
,
{
x
:
this
.
bigLotusLeaf
.
initX
,
y
:
this
.
bigLotusLeaf
.
initY
},
1
,
()
=>
{
tweenChange
(
this
.
bigLotusLeaf
.
lotusLeaf
,
{
x
:
this
.
bigLotusLeaf
.
initX
,
y
:
this
.
bigLotusLeaf
.
initY
},
0.5
,
()
=>
{
this
.
toggleBigLotus
();
this
.
toggleBigLotus
();
...
@@ -1579,21 +1600,27 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1579,21 +1600,27 @@ export class PlayComponent implements OnInit, OnDestroy {
//荷叶放大
//荷叶放大
tweenChange
(
lotusLeaf
.
hl
,
{
scaleX
:
this
.
mapScale
*
1.3
,
scaleY
:
this
.
mapScale
*
1.3
},
0.3
,
()
=>
{
tweenChange
(
lotusLeaf
.
hl
,
{
scaleX
:
this
.
mapScale
*
1.3
,
scaleY
:
this
.
mapScale
*
1.3
},
0.3
,
()
=>
{
});
//5秒后恢复原状
setTimeout
(()
=>
{
//荷叶缩小
//荷叶缩小
tweenChange
(
lotusLeaf
.
hl
,
{
scaleX
:
this
.
mapScale
,
scaleY
:
this
.
mapScale
},
0.3
,
()
=>
{
tweenChange
(
lotusLeaf
.
hl
,
{
scaleX
:
this
.
mapScale
,
scaleY
:
this
.
mapScale
},
0.3
,
()
=>
{
tweenChange
(
lotusLeaf
.
hl
,
{
alpha
:
0
},
0.3
,
()
=>
{
tweenChange
(
lotusLeaf
.
hl
,
{
alpha
:
0
},
0.3
,
()
=>
{
});
});
});
});
});
//阴影放大再缩小
tweenChange
(
lotusLeaf
.
shadow
,
{
scaleX
:
this
.
mapScale
*
1.3
,
scaleY
:
this
.
mapScale
*
1.3
},
0.3
,
()
=>
{
tweenChange
(
lotusLeaf
.
shadow
,
{
scaleX
:
this
.
mapScale
,
scaleY
:
this
.
mapScale
},
0.3
);
tweenChange
(
lotusLeaf
.
shadow
,
{
scaleX
:
this
.
mapScale
,
scaleY
:
this
.
mapScale
},
0.3
);
},
2000
);
//阴影放大
tweenChange
(
lotusLeaf
.
shadow
,
{
scaleX
:
this
.
mapScale
*
1.3
,
scaleY
:
this
.
mapScale
*
1.3
},
0.3
,
()
=>
{
});
});
//停留0.1秒,然后跳出
//停留0.1秒,然后跳出
...
@@ -1799,10 +1826,12 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1799,10 +1826,12 @@ export class PlayComponent implements OnInit, OnDestroy {
//撒花结束
//撒花结束
this
.
playEnd
=
false
;
this
.
playEnd
=
false
;
//清除所有的花瓣
//等待所有花瓣落下后才能点击
this
.
endRenderArr
=
[];
setTimeout
(()
=>
{
this
.
canTouch
=
true
;
},
2000
);
this
.
canTouch
=
true
;
});
});
//显示花瓣
//显示花瓣
...
...
src/assets/play/petal_10.png
View replaced file @
a33af498
View file @
bbb4c9be
882 Bytes
|
W:
|
H:
1.35 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/play/petal_12.png
View replaced file @
a33af498
View file @
bbb4c9be
882 Bytes
|
W:
|
H:
665 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/play/petal_5.png
View replaced file @
a33af498
View file @
bbb4c9be
665 Bytes
|
W:
|
H:
882 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
src/assets/play/petal_8.png
View replaced file @
a33af498
View file @
bbb4c9be
1.35 KB
|
W:
|
H:
882 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
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