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
d5b32c74
Commit
d5b32c74
authored
Jul 09, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
af54c1ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
8 deletions
+45
-8
ng-template-generator_20200709 01-50-06.zip
publish/ng-template-generator_20200709 01-50-06.zip
+0
-0
form.component.html
src/app/form/form.component.html
+1
-1
form.component.ts
src/app/form/form.component.ts
+5
-1
play.component.ts
src/app/play/play.component.ts
+39
-6
No files found.
publish/ng-template-generator_20200709 01-50-06.zip
0 → 100644
View file @
d5b32c74
File added
src/app/form/form.component.html
View file @
d5b32c74
...
...
@@ -14,7 +14,7 @@
音频
</div>
<div
style=
"flex:7"
>
<app-audio-recorder
[
audioUrl
]="
item
.
audio_url
"
(
audioUploaded
)="
onUploadSuccessByItem
($
event
,
item
,
'
audio_url
')"
(
beforePlaying
)="
stopAllAudio
(
i
)"
></app-audio-recorder>
<app-audio-recorder
[
audioUrl
]="
item
.
audio_url
"
(
audioUploaded
)="
onUploadSuccessByItem
($
event
,
item
,
'
audio_url
')"
></app-audio-recorder>
</div>
</div>
</div>
...
...
src/app/form/form.component.ts
View file @
d5b32c74
...
...
@@ -11,7 +11,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item
:
any
;
dataArray
:
Array
<
Object
>
=
[];
contentObj
=
{}
contentObj
=
{
dataArray
:
[]
}
KEY
=
'
DataKey_East_L226
'
;
...
...
@@ -64,8 +66,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
dataArray
=
this
.
item
.
contentObj
.
dataArray
;
}
else
{
this
.
contentObj
=
defauleFormData
;
this
.
dataArray
=
defauleFormData
.
dataArray
// console.log("使用默认数据", this.contentObj)
this
.
item
.
contentObj
=
this
.
contentObj
;
this
.
item
.
contentObj
.
dataArray
=
this
.
dataArray
;
}
}
...
...
src/app/play/play.component.ts
View file @
d5b32c74
...
...
@@ -54,7 +54,7 @@ const zIndexMap = {
Curtain_D
:
99
,
Curtain_E
:
110
,
startButton
:
120
,
liewen
:
41
,
drum
:
30
,
answerCard
:
45
,
questionCard
:
50
,
mainQuestionImage
:
35
,
...
...
@@ -207,7 +207,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initBoy
();
this
.
initCurtain
();
this
.
initStartButton
();
this
.
initRestartButton
()
this
.
initRestartButton
();
this
.
initDrum
();
}
cleanGameVar
(){
...
...
@@ -281,15 +282,15 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
this
.
g_canvasWidth
/
2
,
y
:
this
.
g_canvasHeight
/
2
+
70
*
this
.
g_mapScale
y
:
this
.
g_canvasHeight
/
2
+
45
*
this
.
g_mapScale
}
})
this
.
render
(
element
.
ref
,
zIndexMap
.
boy
)
element
.
ref
.
visible
=
true
element
.
play
=
this
.
g_cartoon
.
createAnimation
(
"
boy
"
,
30
,
500
)
element
.
play
.
x
=
this
.
g_canvasWidth
/
2
;
element
.
play
.
y
=
this
.
g_canvasHeight
/
2
+
70
*
this
.
g_mapScale
element
.
play
.
x
=
element
.
ref
.
x
;
element
.
play
.
y
=
element
.
ref
.
y
;
element
.
play
.
scaleX
=
element
.
ref
.
scaleX
element
.
play
.
scaleY
=
element
.
ref
.
scaleY
element
.
play
.
loop
=
true
;
...
...
@@ -496,9 +497,41 @@ export class PlayComponent implements OnInit, OnDestroy {
})
}
initDrum
(){
if
(
this
.
g_formData
.
dataArray
.
length
==
0
){
return
}
let
totalDrumNum
=
this
.
g_formData
.
dataArray
.
length
-
1
// s20 * this.g_mapScale
let
baseX
=
[
this
.
g_canvasWidth
/
2
,
this
.
g_canvasWidth
/
2
-
(
317
/
2
)
*
this
.
g_mapScale
,
this
.
g_canvasWidth
/
2
-
(
317
)
*
this
.
g_mapScale
,
this
.
g_canvasWidth
/
2
-
(
317
/
2
)
*
3
*
this
.
g_mapScale
]
this
.
g_formData
.
dataArray
.
forEach
((
item
,
index
)
=>
{
let
element
=
this
.
createDrum
(
index
,
item
,
baseX
[
totalDrumNum
])
this
.
render
(
element
.
ref
,
zIndexMap
.
drum
)
});
}
createDrum
(
index
,
data
,
baseX
){
let
color
=
[
"
red
"
,
"
blue
"
,
"
yellow
"
,
"
green
"
]
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`drum=
${
index
}
`
,
color
[
index
],
(
w
,
h
)
=>
{
return
{
sx
:
317
*
this
.
g_mapScale
/
w
,
sy
:
312
*
this
.
g_mapScale
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
baseX
+
index
*
317
*
this
.
g_mapScale
,
y
:
this
.
g_canvasHeight
/
2
+
200
*
this
.
g_mapScale
}
})
return
element
}
...
...
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