Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L228
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_L228
Commits
0a0c19de
Commit
0a0c19de
authored
May 13, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
f1337dc5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
12 deletions
+67
-12
Cartoon.ts
src/app/play/Cartoon.ts
+1
-0
play.component.ts
src/app/play/play.component.ts
+66
-12
No files found.
src/app/play/Cartoon.ts
View file @
0a0c19de
...
...
@@ -270,6 +270,7 @@ export class Cartoon {
let
element
=
new
Label
()
element
.
text
=
text
;
if
(
fontName
){
console
.
log
(
fontName
)
element
.
fontName
=
fontName
;
}
if
(
fontColor
){
...
...
src/app/play/play.component.ts
View file @
0a0c19de
...
...
@@ -224,6 +224,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
initCamera
();
this
.
initCards
();
this
.
m_enableAutoRunFocus
=
true
;
console
.
log
(
"
Init auto
"
)
this
.
autoRunFocus
()
this
.
initShowCard
();
this
.
g_cartoon
.
playAudio
(
"
sm-run
"
,
false
,
null
,
true
,
(
audio
)
=>
{
...
...
@@ -302,6 +303,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
if
(
this
.
m_enableCamera
){
console
.
log
(
"
Enable camera -> 1 false
"
)
this
.
m_enableCamera
=
false
;
this
.
g_cartoon
.
stopAudio
(
"
sm-run
"
)
clearTimeout
(
this
.
m_autoFocusID
)
...
...
@@ -354,11 +356,6 @@ export class PlayComponent implements OnInit, OnDestroy {
})
element
.
content
=
null
;
let
Text
=
new
Label
()
Text
.
text
=
""
+
index
Text
.
textAlign
=
"
center
"
element
.
ref
.
addChild
(
Text
)
// 内容
let
cardContent
=
this
.
g_cartoon
.
createCartoonElementImage
(
`card-content-
${
index
}
`
,
"
Image-05
"
,
210
,
210
,
0
,
0
)
element
.
ref
.
addChild
(
cardContent
.
ref
)
...
...
@@ -379,8 +376,32 @@ export class PlayComponent implements OnInit, OnDestroy {
})
element
.
ref
.
addChild
(
cardImage
)
}
else
{
let
cardText
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
null
,
null
,
20
)
element
.
ref
.
addChild
(
cardText
)
let
textContainer
=
this
.
g_cartoon
.
createImage
(
"
Image-05
"
,
(
w
,
h
)
=>
{
return
{
sx
:
165
/
w
,
sy
:
165
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
0
}
})
textContainer
.
alpha
=
0
let
text
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
"
BerlinSansFBDemi-Bold
"
,
null
,
50
)
let
lineNum
=
data
.
text
.
split
(
"
"
).
length
console
.
log
(
lineNum
)
text
.
maxSingalLineWidth
=
165
text
.
fontColor
=
"
#e05e14
"
;
if
(
lineNum
>
1
){
textContainer
.
y
=
-
(
lineNum
*
50
)
/
2
+
50
}
textContainer
.
addChild
(
text
)
element
.
ref
.
addChild
(
textContainer
)
}
// 高亮
...
...
@@ -477,11 +498,18 @@ export class PlayComponent implements OnInit, OnDestroy {
}
if
(
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
next
]).
ref
.
x
>=
this
.
g_canvasWidth
-
300
*
this
.
g_mapScale
){
this
.
cardRunControl
(
500
*
this
.
g_mapScale
,
()
=>
{
console
.
log
(
"
Enable camera -> 2 false
"
)
this
.
m_enableCamera
=
false
;
this
.
g_enableMapDown
=
false
;
let
distance
=
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
current
]).
ref
.
x
/
2
this
.
cardRunControl
(
distance
,
()
=>
{
if
(
current
!=
-
1
){
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
current
]).
hideHighlight
()
}
this
.
g_cartoon
.
getCartoonElement
(
this
.
m_allCardIds
[
next
]).
showHighlight
(()
=>
{
console
.
log
(
"
Enable camera -> 3 true
"
)
this
.
m_enableCamera
=
true
;
this
.
g_enableMapDown
=
true
;
callback
&&
callback
()
})
this
.
m_currentFocusCard
=
next
;
...
...
@@ -503,6 +531,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
m_enableAutoRunFocus
){
this
.
m_autoFocusID
=
setTimeout
(()
=>
{
if
(
this
.
m_enableAutoRunFocus
){
console
.
log
(
"
Set timeout auto
"
)
this
.
autoRunFocus
()
}
},
3000
)
...
...
@@ -536,7 +565,7 @@ export class PlayComponent implements OnInit, OnDestroy {
clickTarget
.
ref
.
alpha
=
0
;
element
.
ref
.
addChild
(
clickTarget
.
ref
)
let
textContent
=
this
.
g_cartoon
.
createLabel
(
""
,
null
,
null
,
2
0
)
let
textContent
=
this
.
g_cartoon
.
createLabel
(
""
,
"
BerlinSansFBDemi-Bold
"
,
null
,
5
0
)
let
imageContent
=
this
.
g_cartoon
.
createImage
(
"
Image-05
"
,
(
w
,
h
)
=>
{
let
sx
=
165
/
w
;
let
sy
=
165
/
h
;
...
...
@@ -571,8 +600,31 @@ export class PlayComponent implements OnInit, OnDestroy {
})
element
.
ref
.
addChild
(
element
.
imageContent
)
}
else
{
element
.
textContent
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
null
,
null
,
20
)
element
.
ref
.
addChild
(
element
.
textContent
)
let
textContainer
=
this
.
g_cartoon
.
createImage
(
"
Image-05
"
,
(
w
,
h
)
=>
{
return
{
sx
:
165
/
w
,
sy
:
165
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
0
,
y
:
0
}
})
textContainer
.
alpha
=
0
let
text
=
this
.
g_cartoon
.
createLabel
(
data
.
text
,
"
BerlinSansFBDemi-Bold
"
,
null
,
50
)
let
lineNum
=
data
.
text
.
split
(
"
"
).
length
console
.
log
(
lineNum
)
text
.
maxSingalLineWidth
=
165
text
.
fontColor
=
"
#e05e14
"
;
if
(
lineNum
>
1
){
textContainer
.
y
=
-
(
lineNum
*
50
)
/
2
+
50
}
textContainer
.
addChild
(
text
)
element
.
textContent
=
textContainer
element
.
ref
.
addChild
(
textContainer
)
}
if
(
data
.
audio_url
){
element
.
audio_url
=
data
.
audio_url
...
...
@@ -593,6 +645,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_enableAutoRunFocus
=
true
;
element
.
audio_url
=
null
;
this
.
g_cartoon
.
stopAudio
(
element
.
audio_url
)
console
.
log
(
"
Close auto
"
)
this
.
autoRunFocus
()
tweenChange
(
element
.
ref
,
{
scaleX
:
0
,
scaleY
:
0
},
0.3
,
()
=>
{
element
.
ref
.
visible
=
false
;
...
...
@@ -620,9 +673,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
subscribeMapDownEvent
(
closeBntton
.
id
,
()
=>
{
this
.
g_cartoon
.
playAudio
(
"
sm-camera
"
)
console
.
log
(
"
Enable camera -> 4 true
"
)
this
.
m_enableCamera
=
true
;
element
.
hide
(()
=>
{
this
.
g_enableMapDown
=
true
this
.
m_enableCamera
=
true
;
})
})
...
...
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