Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L226
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
East_L226
Commits
ab47c8a5
Commit
ab47c8a5
authored
Jul 14, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
7a23a03a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
ng-template-generator_20200714 12-19-21.zip
publish/ng-template-generator_20200714 12-19-21.zip
+0
-0
play.component.ts
src/app/play/play.component.ts
+28
-1
No files found.
publish/ng-template-generator_2020071
3 16-42-49
.zip
→
publish/ng-template-generator_2020071
4 12-19-21
.zip
View file @
ab47c8a5
No preview for this file type
src/app/play/play.component.ts
View file @
ab47c8a5
...
...
@@ -133,6 +133,7 @@ export class PlayComponent implements OnInit, OnDestroy {
m_allDrums
=
[];
m_dataArrayNew
=
[];
m_restartGameFlag
:
boolean
=
false
;
m_drumFontSize
:
any
=
84
;
// ------------------------------------
...
...
@@ -202,6 +203,7 @@ export class PlayComponent implements OnInit, OnDestroy {
initGame
(){
console
.
log
(
this
.
g_formData
);
this
.
m_drumFontSize
=
this
.
getMaxFontSize
()
this
.
initBackground
();
this
.
initBoy
();
this
.
initCurtain
();
...
...
@@ -209,6 +211,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initRestartButton
();
this
.
initDrum
();
this
.
initLight
();
console
.
log
(
this
.
m_drumFontSize
)
}
cleanGameVar
(){
...
...
@@ -232,6 +235,29 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
g_cartoon
.
getCartoonElement
(
"
restart-button
"
).
in
()
}
getMaxFontSize
(){
let
lengthAll
=
[]
this
.
g_formData
.
dataArray
.
forEach
(
element
=>
{
if
(
element
.
type
==
"
Text
"
){
lengthAll
.
push
(
element
.
text
.
length
)
}
});
let
maxLength
=
Math
.
max
(...
lengthAll
)
if
(
maxLength
<=
5
){
return
84
}
else
if
(
maxLength
>
5
&&
maxLength
<=
10
){
return
42
}
else
if
(
maxLength
>
10
&&
maxLength
<=
15
){
return
28
}
else
if
(
maxLength
>
15
&&
maxLength
<=
20
){
return
21
}
else
if
(
maxLength
>
20
&&
maxLength
<=
25
){
return
16
}
else
{
return
7
}
}
initBackground
(){
let
mainBG
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
main-background
"
,
"
background
"
,
(
w
,
h
)
=>
{
return
{
...
...
@@ -515,6 +541,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
else
{
element
.
rightHand
.
ref
.
visible
=
false
}
element
.
beatAnimate
.
setScaleXY
(
this
.
g_mapScale
)
this
.
render
(
element
.
beatAnimate
,
zIndexMap
.
animation
)
element
.
beatAnimate
.
play
()
}
...
...
@@ -867,7 +894,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
textContainer
.
visible
=
false
;
element
.
textContainer
.
setScaleXY
(
0
)
element
.
content
=
element
.
textContainer
element
.
text
=
this
.
g_cartoon
.
createLabel
(
contentData
.
text
,
"
BerlinSansFBDemi-Bold
"
,
"
#b94918
"
,
84
)
element
.
text
=
this
.
g_cartoon
.
createLabel
(
contentData
.
text
,
"
BerlinSansFBDemi-Bold
"
,
"
#b94918
"
,
this
.
m_drumFontSize
)
element
.
text
.
outline
=
15
;
element
.
ref
.
addChild
(
element
.
textContainer
)
...
...
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