Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU03
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
PU03
Commits
0fad37c7
Commit
0fad37c7
authored
Jun 12, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
3141502e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
112 additions
and
10 deletions
+112
-10
play.component.ts
src/app/play/play.component.ts
+101
-9
resources.js
src/app/play/resources.js
+3
-0
bg_card_down.png
src/assets/play/bg_card_down.png
+0
-0
border_left.png
src/assets/play/border_left.png
+0
-0
border_right.png
src/assets/play/border_right.png
+0
-0
defaultData.js
src/assets/play/default/formData/defaultData.js
+8
-1
icon_laba (2).png
src/assets/play/frame/icon_laba (2).png
+0
-0
icon_laba (3).png
src/assets/play/frame/icon_laba (3).png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
0fad37c7
...
...
@@ -40,10 +40,10 @@ import TWEEN from "@tweenjs/tween.js";
import
defauleFormData
from
'
../../assets/play/default/formData/defaultData.js
'
const
zIndexMap
=
{
startButton
:
90
0
,
startButtonBubbing
:
85
0
,
audioSlider
:
90
0
longAudioPlay
:
11
0
,
cardUp
:
11
0
,
lianzi
:
100
,
window
:
5
0
}
@
Component
({
...
...
@@ -182,6 +182,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initXuanZhuanTai
()
this
.
initTable
()
this
.
initShowWindow
()
this
.
initCard_up
()
}
cleanGameVar
(){
...
...
@@ -505,7 +506,6 @@ export class PlayComponent implements OnInit, OnDestroy {
longAudio
.
refreshAudioProgress
=
()
=>
{
slider
.
enableSlider
=
false
;
let
dis
=
slider
.
ref
.
x
+
(
527
/
2
)
console
.
log
(
dis
)
let
per
=
dis
/
527
longAudio
.
audio
.
currentTime
=
longAudio
.
audio
.
duration
*
per
}
...
...
@@ -556,7 +556,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
this
.
g_enableMapDown
=
true
;
})
this
.
render
(
longAudio
.
ref
,
110
)
this
.
render
(
longAudio
.
ref
,
zIndexMap
.
longAudioPlay
)
}
if
(
enableShortAudio
){
// 音乐内容
...
...
@@ -571,7 +571,7 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
-
80
}
})
shortAudio
.
play
=
this
.
g_cartoon
.
createAnimation
(
"
icon_laba
"
,
3
,
2
00
)
shortAudio
.
play
=
this
.
g_cartoon
.
createAnimation
(
"
icon_laba
"
,
3
,
5
00
)
shortAudio
.
play
.
x
=
-
50
;
shortAudio
.
play
.
y
=
-
7
;
shortAudio
.
ref
.
addChild
(
shortAudio
.
play
)
...
...
@@ -600,13 +600,105 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
ref
.
addChild
(
shortAudio
.
ref
)
}
this
.
render
(
lianzi
.
ref
,
100
)
this
.
render
(
element
.
ref
,
50
)
this
.
render
(
lianzi
.
ref
,
zIndexMap
.
lianzi
)
this
.
render
(
element
.
ref
,
zIndexMap
.
window
)
}
initCard_up
(){
let
xuanzhuanTai
=
this
.
g_cartoon
.
getCartoonElement
(
"
XuanZhuanTai
"
)
let
cardAll
=
[]
this
.
g_formData
.
textUp
.
forEach
(
item
=>
{
let
labelText
=
this
.
g_cartoon
.
createLabel
(
item
.
text
,
"
BRLNSR_1
"
,
"
#634846
"
,
50
)
labelText
.
setScaleXY
(
this
.
g_mapScale
)
labelText
.
refreshSize
();
cardAll
.
push
(
labelText
)
});
let
spaceing
=
10
*
this
.
g_mapScale
;
let
totalWidth
=
0
let
totalNum
=
cardAll
.
length
cardAll
.
forEach
((
element
,
index
)
=>
{
console
.
log
(
"
Label width:
"
+
element
.
width
)
if
(
index
==
0
||
index
==
(
totalNum
-
1
)){
totalWidth
+=
(
element
.
width
/
2
)
+
spaceing
}
else
{
totalWidth
+=
(
element
.
width
)
+
spaceing
}
});
let
baseFontsize
=
50
let
fontSize
=
50
;
let
adjustSX
=
1
if
(
totalWidth
>
1214
){
// adjustSX = (1200 / totalWidth)
fontSize
=
baseFontsize
*
(
1214
/
(
totalWidth
*
1.65
))
}
console
.
log
(
totalWidth
,
fontSize
)
cardAll
.
forEach
((
card
,
index
)
=>
{
card
.
fontSize
=
fontSize
card
.
refreshSize
()
})
let
lastWidth
=
0
let
cardX
=
xuanzhuanTai
.
ref
.
x
-
(
xuanzhuanTai
.
ref
.
width
*
this
.
g_mapScale
)
/
2
+
100
*
this
.
g_mapScale
cardAll
.
forEach
((
card
,
index
)
=>
{
let
pos
=
{
x
:
0
,
y
:
0
}
if
(
index
!=
0
){
pos
=
{
x
:
cardX
+
((
card
.
width
+
20
)
*
this
.
g_mapScale
)
/
2
,
y
:
xuanzhuanTai
.
ref
.
y
+
10
*
this
.
g_mapScale
}
cardX
=
cardX
+
(
card
.
width
+
20
)
*
this
.
g_mapScale
+
20
*
this
.
g_mapScale
}
else
{
pos
=
{
x
:
cardX
,
y
:
xuanzhuanTai
.
ref
.
y
+
10
*
this
.
g_mapScale
}
cardX
=
cardX
+
((
card
.
width
+
20
)
*
this
.
g_mapScale
)
/
2
+
20
*
this
.
g_mapScale
}
this
.
createCardUp
(
index
,
card
,
pos
)
})
}
createCardUp
(
index
,
label
,
pos
){
pos
.
y
=
pos
.
y
+
20
*
this
.
g_mapScale
label
.
x
=
pos
.
x
label
.
y
=
pos
.
y
let
card
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`card-up-
${
index
}
`
,
"
bg_kuang1
"
,
(
w
,
h
)
=>
{
return
{
sx
:
(
label
.
width
+
20
)
*
this
.
g_mapScale
/
w
,
sy
:
84
*
this
.
g_mapScale
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
pos
.
x
,
y
:
pos
.
y
}
})
let
panzi
=
this
.
g_cartoon
.
createImage
(
"
pan_zi
"
,
(
w
,
h
)
=>
{
return
{
sx
:
98
*
this
.
g_mapScale
/
w
,
sy
:
70
*
this
.
g_mapScale
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
pos
.
x
,
y
:
pos
.
y
+
(
84
*
this
.
g_mapScale
)
/
2
}
})
card
.
text
=
label
;
card
.
panzi
=
panzi
;
this
.
render
(
panzi
,
zIndexMap
.
cardUp
)
this
.
render
(
card
.
ref
,
zIndexMap
.
cardUp
)
this
.
render
(
label
,
zIndexMap
.
cardUp
)
}
...
...
src/app/play/resources.js
View file @
0fad37c7
...
...
@@ -63,6 +63,9 @@ const localImages = {
'
bg_main_window
'
:
'
assets/play/bg_main_window.png
'
,
'
default_Image
'
:
'
assets/play/Default_Image.png
'
,
'
audio_play_click
'
:
'
assets/play/audio_play_click.png
'
,
'
bg_card_down
'
:
'
assets/play/bg_card_down.png
'
,
'
border_left
'
:
'
assets/play/border_left.png
'
,
'
border_right
'
:
'
assets/play/border_right.png
'
,
'
bg_star (1)
'
:
'
assets/play/frame/bg_star (1).png
'
,
'
bg_star (10)
'
:
'
assets/play/frame/bg_star (10).png
'
,
...
...
src/assets/play/bg_card_down.png
0 → 100644
View file @
0fad37c7
1.97 KB
src/assets/play/border_left.png
0 → 100644
View file @
0fad37c7
1.78 KB
src/assets/play/border_right.png
0 → 100644
View file @
0fad37c7
1.78 KB
src/assets/play/default/formData/defaultData.js
View file @
0fad37c7
...
...
@@ -8,8 +8,15 @@ export default {
shortAudio_url
:
"
default_short_audio
"
,
longAudio_url
:
"
default_long_audio
"
},
// textUp:[
// {text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""},
// {text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""},
// {text:"make friends", lineTo:""},{text:"lound", lineTo:""},{text:"we eat ice cream", lineTo:""},{text:"very happy", lineTo:""}
// ],
textUp
:[
{
text
:
"
make friends
"
,
lineTo
:
""
},{
text
:
"
lound
"
,
lineTo
:
""
},{
text
:
"
we eat ice cream
"
,
lineTo
:
""
},{
text
:
"
very happy
"
,
lineTo
:
""
}
{
text
:
"
make friends
"
,
lineTo
:
""
},{
text
:
"
lound
"
,
lineTo
:
""
},{
text
:
"
we eat ice cream
"
,
lineTo
:
""
},{
text
:
"
very happy
"
,
lineTo
:
""
},
{
text
:
"
make friends
"
,
lineTo
:
""
},{
text
:
"
lound
"
,
lineTo
:
""
},{
text
:
"
we eat ice cream
"
,
lineTo
:
""
},{
text
:
"
very happy
"
,
lineTo
:
""
},
{
text
:
"
make friends
"
,
lineTo
:
""
}
],
textDown
:[
{
text
:
"
it's so much fun
"
,
lineTo
:
""
},{
text
:
"
lound
"
,
lineTo
:
""
},{
text
:
"
very happy
"
,
lineTo
:
""
},{
text
:
"
sun
"
,
lineTo
:
""
},{
text
:
"
at the park
"
,
lineTo
:
""
}
...
...
src/assets/play/frame/icon_laba (
4
).png
→
src/assets/play/frame/icon_laba (
2
).png
View file @
0fad37c7
File moved
src/assets/play/frame/icon_laba (
5
).png
→
src/assets/play/frame/icon_laba (
3
).png
View file @
0fad37c7
File moved
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