Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU01
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
PU01
Commits
13070a82
Commit
13070a82
authored
Jun 22, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
8b4ced49
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
182 additions
and
18 deletions
+182
-18
play.component.ts
src/app/play/play.component.ts
+175
-14
resources.js
src/app/play/resources.js
+4
-1
bg_change_1.png
src/assets/play/bg_change_1.png
+0
-0
defaultData.js
src/assets/play/default/formData/defaultData.js
+3
-3
text_border_left.png
src/assets/play/text_border_left.png
+0
-0
text_border_right.png
src/assets/play/text_border_right.png
+0
-0
text_center.png
src/assets/play/text_center.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
13070a82
...
...
@@ -241,7 +241,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
subscribeMapUpEvent
(
"
background-color
"
,
()
=>
{
let
slider
=
this
.
g_cartoon
.
getCartoonElement
(
"
audio-plyer-slider
"
)
if
(
slider
.
enableSlider
){
if
(
slider
&&
slider
.
enableSlider
){
slider
.
release
()
this
.
disableMoveAsstant
();
}
...
...
@@ -267,26 +267,163 @@ export class PlayComponent implements OnInit, OnDestroy {
// 问题卡片 文字
initQuestionCard_Text
(){
this
.
m_questionCard_All
.
push
(
this
.
createQuestionCardText
(
0
,
{}))
this
.
m_questionCard_All
.
push
(
this
.
createQuestionCardText
(
1
,
{}))
this
.
m_questionCard_All
.
push
(
this
.
createQuestionCardText
(
2
,
{}))
this
.
m_questionCard_All
.
push
(
this
.
createQuestionCardText
(
3
,
{}))
this
.
g_formData
.
dataArray
.
forEach
((
element
,
index
)
=>
{
this
.
m_questionCard_All
.
push
(
this
.
createQuestionCardText
(
index
,
element
))
});
this
.
alignCenter
(
this
.
m_questionCard_All
,
20
*
this
.
g_mapScale
,
true
)
}
createQuestionCardText
(
index
,
data
){
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-
"
+
index
,
"
bg_change
"
,
(
w
,
h
)
=>
{
createQuestionCardText
(
index
,
text
){
let
element
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
questioncard-text-
"
+
index
,
"
"
+
text
+
"
"
,
"
BRLNSDB
"
,
"
#FFFFFF
"
,
60
*
this
.
g_mapScale
,
0
,
this
.
g_cartoon
.
getOrigin
().
y
+
720
*
this
.
g_mapScale
-
250
*
this
.
g_mapScale
)
let
imageBD
=
element
.
ref
.
getBoundingBox
()
let
cardHeight
=
127
// 边框
let
borderLeft
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-border-left-
"
+
index
,
"
image_border_left
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
166
*
this
.
g_mapScale
)
/
w
,
sy
:
(
128
*
this
.
g_mapScale
)
/
h
sx
:
(
22
/
element
.
ref
.
scaleX
)
/
w
,
sy
:
(((
cardHeight
-
8
)
*
this
.
g_mapScale
)
/
element
.
ref
.
scaleY
)
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
-
(
imageBD
.
width
/
element
.
ref
.
scaleX
)
/
2
,
y
:
13
}
})
element
.
ref
.
addChild
(
borderLeft
.
ref
)
let
borderRight
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-border-right-
"
+
index
,
"
image_border_right
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
22
/
element
.
ref
.
scaleX
)
/
w
,
sy
:
(((
cardHeight
-
8
)
*
this
.
g_mapScale
)
/
element
.
ref
.
scaleY
)
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
(
imageBD
.
width
/
element
.
ref
.
scaleX
)
/
2
,
y
:
13
}
})
element
.
ref
.
addChild
(
borderRight
.
ref
)
let
border
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-border-
"
+
index
,
"
text_center
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
imageBD
.
width
/
element
.
ref
.
scaleX
)
/
w
,
sy
:
((
cardHeight
*
this
.
g_mapScale
)
/
element
.
ref
.
scaleY
)
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
this
.
g_cartoon
.
getOrigin
().
y
+
720
*
this
.
g_mapScale
-
258
*
this
.
g_mapScale
y
:
13
}
})
element
.
ref
.
addChild
(
border
.
ref
)
// 高亮边框
let
border_H
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-border-h-
"
+
index
,
"
border_center
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
imageBD
.
width
/
element
.
ref
.
scaleX
)
/
w
,
sy
:
((
cardHeight
*
this
.
g_mapScale
)
/
element
.
ref
.
scaleY
)
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
8
}
})
element
.
ref
.
addChild
(
border_H
.
ref
)
let
borderLeft_H
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-border-h-left-
"
+
index
,
"
border_left
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
22
/
element
.
ref
.
scaleX
)
/
w
,
sy
:
((
cardHeight
*
this
.
g_mapScale
)
/
element
.
ref
.
scaleY
)
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
-
(
imageBD
.
width
/
element
.
ref
.
scaleX
)
/
2
-
5
,
y
:
9
}
})
element
.
ref
.
addChild
(
borderLeft_H
.
ref
)
let
borderRight_H
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
questioncard-text-border-h-right-
"
+
index
,
"
border_right
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
22
/
element
.
ref
.
scaleX
)
/
w
,
sy
:
((
cardHeight
*
this
.
g_mapScale
)
/
element
.
ref
.
scaleY
)
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
(
imageBD
.
width
/
element
.
ref
.
scaleX
)
/
2
+
5
,
y
:
9
}
})
element
.
ref
.
addChild
(
borderRight_H
.
ref
)
let
text_copy
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
questioncard-text-
"
+
index
+
"
-copy
"
,
text
,
"
BRLNSDB
"
,
"
#d94158
"
,
60
*
this
.
g_mapScale
,
0
,
0
)
let
text_copy_shadow
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
questioncard-text-
"
+
index
+
"
-copy
"
,
text
,
"
BRLNSDB
"
,
"
#fdf0cd
"
,
60
*
this
.
g_mapScale
,
0
,
5
)
element
.
ref
.
addChild
(
text_copy_shadow
.
ref
)
element
.
ref
.
addChild
(
text_copy
.
ref
)
border_H
.
ref
.
visible
=
false
;
borderRight_H
.
ref
.
visible
=
false
;
borderLeft_H
.
ref
.
visible
=
false
;
element
.
startPos
=
{
x
:
element
.
initX
,
y
:
element
.
initY
}
element
.
backTo
=
(
pos
?,
callback
?)
=>
{
if
(
pos
){
tweenChange
(
element
.
ref
,
pos
,
0.1
,
()
=>
{
callback
&&
callback
()
})
}
else
{
tweenChange
(
element
.
ref
,
{
x
:
element
.
initX
,
y
:
element
.
initY
},
0.3
,
()
=>
{
callback
&&
callback
()
})
}
}
element
.
disable
=
false
;
element
.
release
=
(
pos
,
callback
?)
=>
{
this
.
m_enableCardMove
=
false
;
this
.
m_currentSelectedCardID
=
null
;
border_H
.
ref
.
visible
=
false
;
borderRight_H
.
ref
.
visible
=
false
;
borderLeft_H
.
ref
.
visible
=
false
;
this
.
disableMoveAsstant
()
element
.
backTo
(
pos
,
callback
)
}
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
if
(
element
.
disable
){
this
.
g_enableMapDown
=
true
;
return
}
this
.
m_enableCardMove
=
true
;
this
.
m_currentSelectedCardID
=
element
.
id
border_H
.
ref
.
visible
=
true
;
borderRight_H
.
ref
.
visible
=
true
;
borderLeft_H
.
ref
.
visible
=
true
;
this
.
topOfRenderArray
(
element
.
ref
)
element
.
startPos
=
{
x
:
this
.
g_clickX
,
y
:
this
.
g_clickY
}
this
.
enableMoveAsstant
(()
=>
{
element
.
ref
.
x
=
this
.
g_clickX
element
.
ref
.
y
=
this
.
g_clickY
})
this
.
g_enableMapDown
=
true
;
})
this
.
subscribeMapUpEvent
(
element
.
id
,
()
=>
{
if
(
element
.
disable
){
this
.
g_enableMapUp
=
true
;
return
}
element
.
release
()
this
.
g_enableMapUp
=
true
;
})
this
.
render
(
element
.
ref
,
zIndexMap
.
questionCard
)
return
element
...
...
@@ -469,7 +606,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_answerCard_All
.
push
(
this
.
createAnswerCardText
(
2
,
{}))
this
.
m_answerCard_All
.
push
(
this
.
createAnswerCardText
(
3
,
{}))
this
.
alignCenter
(
this
.
m_answerCard_All
,
2
0
*
this
.
g_mapScale
,
true
)
this
.
alignCenter
(
this
.
m_answerCard_All
,
1
0
*
this
.
g_mapScale
,
true
)
}
createAnswerCardText
(
index
,
data
){
...
...
@@ -485,6 +622,28 @@ export class PlayComponent implements OnInit, OnDestroy {
}
})
this
.
subscribeMapUpEvent
(
element
.
id
,
()
=>
{
if
(
this
.
m_currentSelectedCardID
&&
this
.
m_enableCardMove
){
let
selectedCard
=
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_currentSelectedCardID
)
selectedCard
.
ref
.
x
=
element
.
ref
.
x
selectedCard
.
ref
.
y
=
element
.
ref
.
y
selectedCard
.
release
({
x
:
element
.
ref
.
x
,
y
:
element
.
ref
.
y
-
10
*
this
.
g_mapScale
},
()
=>
{
if
(
this
.
g_formData
.
answerType
==
"
Image
"
){
this
.
alignCenter
(
this
.
m_answerCard_All
,
30
*
this
.
g_mapScale
,
true
)
}
else
{
this
.
alignCenter
(
this
.
m_answerCard_All
,
20
*
this
.
g_mapScale
,
true
)
}
})
selectedCard
.
disable
=
true
;
let
index
=
this
.
m_answerCard_All
.
indexOf
(
element
)
this
.
m_answerCard_All
.
splice
(
index
,
1
,
selectedCard
)
this
.
deleteElementInRender
(
element
.
id
)
this
.
topOfRenderArray
(
this
.
g_cartoon
.
getCartoonElement
(
"
background-main-xia
"
).
ref
)
}
this
.
g_enableMapUp
=
true
;
return
true
},
100
)
this
.
render
(
element
.
ref
,
zIndexMap
.
answerCard
)
return
element
}
...
...
@@ -518,7 +677,11 @@ export class PlayComponent implements OnInit, OnDestroy {
selectedCard
.
ref
.
x
=
element
.
ref
.
x
selectedCard
.
ref
.
y
=
element
.
ref
.
y
selectedCard
.
release
({
x
:
element
.
ref
.
x
,
y
:
element
.
ref
.
y
-
6
*
this
.
g_mapScale
},
()
=>
{
this
.
alignCenter
(
this
.
m_answerCard_All
,
30
*
this
.
g_mapScale
,
true
)
if
(
this
.
g_formData
.
answerType
==
"
Image
"
){
this
.
alignCenter
(
this
.
m_answerCard_All
,
30
*
this
.
g_mapScale
,
true
)
}
else
{
this
.
alignCenter
(
this
.
m_answerCard_All
,
20
*
this
.
g_mapScale
,
true
)
}
})
selectedCard
.
disable
=
true
;
let
index
=
this
.
m_answerCard_All
.
indexOf
(
element
)
...
...
@@ -679,8 +842,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
// longAudio.ref.addChild(audioClick.ref)
// longAudio.ref.addChild(longAudio_pause)
progressBar
.
ref
.
addChild
(
timeStart
.
ref
)
progressBar
.
ref
.
addChild
(
timeEnd
.
ref
)
progressBar
.
ref
.
addChild
(
coverColor
)
...
...
src/app/play/resources.js
View file @
13070a82
...
...
@@ -29,7 +29,7 @@ const localImages = {
'
bg_bg
'
:
'
assets/play/bg_bg.png
'
,
'
bg_bottom
'
:
'
assets/play/bg_bottom.png
'
,
'
bg_change
'
:
'
assets/play/bg_change.png
'
,
'
bg_change
'
:
'
assets/play/bg_change
_1
.png
'
,
'
bg_change2
'
:
'
assets/play/bg_change2-1.png
'
,
'
bg_kuang1
'
:
'
assets/play/bg_kuang1.png
'
,
'
bg_kuang2
'
:
'
assets/play/bg_kuang2.png
'
,
...
...
@@ -53,6 +53,9 @@ const localImages = {
'
image_border_left
'
:
'
assets/play/image_border_left.png
'
,
'
image_border_right
'
:
'
assets/play/image_border_right.png
'
,
'
image_center
'
:
'
assets/play/image_center.png
'
,
'
text_border_left
'
:
'
assets/play/text_border_left.png
'
,
'
text_border_right
'
:
'
assets/play/text_border_right.png
'
,
'
text_center
'
:
'
assets/play/text_center.png
'
,
'
border_left
'
:
'
assets/play/border_left.png
'
,
'
border_right
'
:
'
assets/play/border_right.png
'
,
'
border_center
'
:
'
assets/play/border_center.png
'
,
...
...
src/assets/play/bg_change_1.png
0 → 100644
View file @
13070a82
5.88 KB
src/assets/play/default/formData/defaultData.js
View file @
13070a82
...
...
@@ -2,8 +2,8 @@ export default {
"
version
"
:
"
1.0
"
,
key
:
"
DataKey_PU01
"
,
question
:
{
type
:
"
Audio
"
type
:
"
Image
"
},
answerType
:
"
Image
"
,
dataArray
:
[]
answerType
:
"
Text
"
,
dataArray
:
[
"
This is for test
"
,
"
Apple
"
,
"
Building
"
,
"
Lovely Puppy
"
]
}
\ No newline at end of file
src/assets/play/text_border_left.png
0 → 100644
View file @
13070a82
2.82 KB
src/assets/play/text_border_right.png
0 → 100644
View file @
13070a82
2.81 KB
src/assets/play/text_center.png
0 → 100644
View file @
13070a82
2.39 KB
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