Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FT_12
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
FT_12
Commits
606ebabf
Commit
606ebabf
authored
Dec 28, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
音频调整
parent
0385b399
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
9 deletions
+48
-9
form.component.html
form/src/app/form/form.component.html
+7
-3
form.component.ts
form/src/app/form/form.component.ts
+5
-1
ItemAnswer.js
play/assets/tmpGame/script/ItemAnswer.js
+16
-0
Scene.js
play/assets/tmpGame/script/Scene.js
+20
-5
No files found.
form/src/app/form/form.component.html
View file @
606ebabf
...
@@ -23,19 +23,23 @@
...
@@ -23,19 +23,23 @@
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content border"
>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页题干:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
第{{i + 1}}页题干:
</span>
<br>
<br>
<span
style=
"height: 30px; font-size: 18px;"
>
题干音频:
</span>
<app-audio-recorder
[
audioUrl
]="
question
.
pageAudio
"
(
audioUploaded
)="
onPageUploadSuccess
($
event
,
i
)"
>
</app-audio-recorder>
<br>
<div
*
ngFor=
"let option of question.optionList; let j = index"
class=
"section-content;text-align:center"
<div
*
ngFor=
"let option of question.optionList; let j = index"
class=
"section-content;text-align:center"
style=
"padding: 0.5vw; display: inline-block"
>
style=
"padding: 0.5vw; display: inline-block"
>
<div
style=
"margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
<div
style=
"margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
padding: 20px; margin-right: 20px; width: 230px;"
>
padding: 20px; margin-right: 20px; width: 230px;"
>
<span
style=
"height: 30px; font-size: 18px;"
>
题干
音频:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
选项
音频:
</span>
<app-audio-recorder
[
audioUrl
]="
option
.
optionAudio
"
(
audioUploaded
)="
onOptionUploadSuccess
($
event
,
i
,
j
)"
>
<app-audio-recorder
[
audioUrl
]="
option
.
optionAudio
"
(
audioUploaded
)="
onOptionUploadSuccess
($
event
,
i
,
j
)"
>
</app-audio-recorder>
</app-audio-recorder>
<br>
<br>
<span
style=
"height: 30px; font-size: 18px;"
>
题干
文本:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
选项
文本:
</span>
<input
style=
"width: 150px; "
type=
"text"
maxlength=
""
nz-input
[(
ngModel
)]="
option
.
text
"
(
blur
)="
save
()"
>
<input
style=
"width: 150px; "
type=
"text"
maxlength=
""
nz-input
[(
ngModel
)]="
option
.
text
"
(
blur
)="
save
()"
>
<br>
<br>
<span
style=
"height: 30px; font-size: 18px;"
>
题干
骨骼动画:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
选项
骨骼动画:
</span>
<app-upload-dragon-bone
[
btnName
]="[['配置骨骼动画']]"
[
animaNames
]="[[['
normal
']]]"
<app-upload-dragon-bone
[
btnName
]="[['配置骨骼动画']]"
[
animaNames
]="[[['
normal
']]]"
[
skeJsonData
]=
option
.
optionDragonBone
.
skeJsonData
[
texJsonData
]=
option
.
optionDragonBone
.
texJsonData
[
skeJsonData
]=
option
.
optionDragonBone
.
skeJsonData
[
texJsonData
]=
option
.
optionDragonBone
.
texJsonData
[
texPngData
]=
option
.
optionDragonBone
.
texPngData
(
save
)="
saveAnima
($
event
,
option
.
optionDragonBone
)"
[
texPngData
]=
option
.
optionDragonBone
.
texPngData
(
save
)="
saveAnima
($
event
,
option
.
optionDragonBone
)"
...
...
form/src/app/form/form.component.ts
View file @
606ebabf
...
@@ -22,6 +22,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -22,6 +22,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
addQuestion
()
{
addQuestion
()
{
this
.
item
.
questionList
.
push
(
this
.
item
.
questionList
.
push
(
{
{
"
pageAudio
"
:
""
,
"
rightOptionIdx
"
:
0
,
"
rightOptionIdx
"
:
0
,
"
optionList
"
:
[{
"
optionList
"
:
[{
"
text
"
:
""
,
"
text
"
:
""
,
...
@@ -115,7 +116,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -115,7 +116,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
init
()
{
init
()
{
}
}
onPageUploadSuccess
(
e
,
questionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
pageAudio
=
e
.
url
;
this
.
save
();
}
onOptionUploadSuccess
(
e
,
questionIdx
,
optionIdx
)
{
onOptionUploadSuccess
(
e
,
questionIdx
,
optionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
optionList
[
optionIdx
].
optionAudio
=
e
.
url
;
this
.
item
.
questionList
[
questionIdx
].
optionList
[
optionIdx
].
optionAudio
=
e
.
url
;
this
.
save
();
this
.
save
();
...
...
play/assets/tmpGame/script/ItemAnswer.js
View file @
606ebabf
...
@@ -136,11 +136,27 @@ cc.Class({
...
@@ -136,11 +136,27 @@ cc.Class({
// this.dragonBone.premultipliedAlpha = true;
// this.dragonBone.premultipliedAlpha = true;
// atlas.texture.setPremultiplyAlpha(true);
// atlas.texture.setPremultiplyAlpha(true);
this
.
setSpineScale
(
data
.
canvas
);
}
}
});
});
}
}
});
});
},
},
setSpineScale
(
size
)
{
let
bgWidth
=
200
;
let
bgHeight
=
200
;
if
(
size
.
width
!=
bgWidth
||
size
.
height
!=
bgHeight
)
{
let
designScale
=
bgWidth
/
bgHeight
;
let
scale
=
size
.
width
/
size
.
height
;
if
(
scale
>
designScale
)
{
this
.
dragonBone
.
node
.
parent
.
scale
=
bgWidth
/
size
.
width
;
}
else
{
this
.
dragonBone
.
node
.
parent
.
scale
=
bgHeight
/
size
.
height
;
}
}
},
chooseRight
()
{
chooseRight
()
{
this
.
showLight
();
this
.
showLight
();
this
.
playAudioRight
();
this
.
playAudioRight
();
...
...
play/assets/tmpGame/script/Scene.js
View file @
606ebabf
...
@@ -214,10 +214,9 @@ cc.Class({
...
@@ -214,10 +214,9 @@ cc.Class({
this
.
playAudioQuestion
();
this
.
playAudioQuestion
();
})
})
},
},
playAudioPage
(
isBtn
)
{
playAudioQuestion
(
isBtn
)
{
GameData
.
audioCount
++
;
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
question
Audio
;
let
url
=
this
.
data
.
page
Audio
;
// url = 'http://127.0.0.1/iamflying.mp3';
// url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
if
(
err
)
{
...
@@ -234,6 +233,22 @@ cc.Class({
...
@@ -234,6 +233,22 @@ cc.Class({
})
})
});
});
},
},
playAudioQuestion
()
{
GameData
.
audioCount
++
;
let
url
=
this
.
data
.
questionAudio
;
// url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
url
,
null
,
(
err
,
clip
)
=>
{
if
(
err
)
{
console
.
log
(
err
)
return
;
}
let
id
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
GameData
.
audioCount
--
;
this
.
playAudioPage
();
})
});
},
playAudioMove
()
{
playAudioMove
()
{
GameData
.
audioCount
++
;
GameData
.
audioCount
++
;
let
id
=
cc
.
audioEngine
.
play
(
this
.
audMove
,
false
,
1
);
let
id
=
cc
.
audioEngine
.
play
(
this
.
audMove
,
false
,
1
);
...
@@ -398,7 +413,7 @@ cc.Class({
...
@@ -398,7 +413,7 @@ cc.Class({
this
.
nodeDict
.
nodMask
.
parent
=
this
.
node
;
this
.
nodeDict
.
nodMask
.
parent
=
this
.
node
;
cc
.
audioEngine
.
stopAll
();
cc
.
audioEngine
.
stopAll
();
this
.
initData
();
this
.
initData
();
this
.
playAudio
Question
();
this
.
playAudio
Page
();
GameData
.
startStepDone
=
false
;
GameData
.
startStepDone
=
false
;
},
},
onTurnLast
()
{
onTurnLast
()
{
...
@@ -421,7 +436,7 @@ cc.Class({
...
@@ -421,7 +436,7 @@ cc.Class({
if
(
GameData
.
audioCount
!=
0
)
{
if
(
GameData
.
audioCount
!=
0
)
{
return
;
return
;
}
}
this
.
playAudio
Question
(
true
);
this
.
playAudio
Page
(
true
);
}
else
if
(
button
.
node
.
name
==
'
btnLast
'
)
{
}
else
if
(
button
.
node
.
name
==
'
btnLast
'
)
{
this
.
onTurnLast
();
this
.
onTurnLast
();
}
else
if
(
button
.
node
.
name
==
'
btnReplay
'
)
{
}
else
if
(
button
.
node
.
name
==
'
btnReplay
'
)
{
...
...
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