Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
East_L215
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_L215
Commits
240de8dc
Commit
240de8dc
authored
Apr 12, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
3f27e6d2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
10 deletions
+56
-10
play.component.ts
src/app/play/play.component.ts
+52
-8
resources.js
src/app/play/resources.js
+4
-2
_XnoImage.png
src/assets/default/images/_XnoImage.png
+0
-0
image_none.png
src/assets/default/images/image_none.png
+0
-0
tablecloth.png
src/assets/play/tablecloth.png
+0
-0
No files found.
src/app/play/play.component.ts
View file @
240de8dc
...
...
@@ -52,7 +52,11 @@ const defauleFormData = {
{
type
:
"
Text
"
,
text
:
"
Apple
"
,
audio_url
:
"
apple-demo
"
},
{
type
:
"
Image
"
,
image_url
:
"
bee-demo
"
,
audio_url
:
"
bee-demo
"
},
{
type
:
"
Text
"
,
text
:
"
Apple
"
,
audio_url
:
"
apple-demo
"
}
]
],
cardContainerSetting
:
{
type
:
"
D
"
,
image_url
:
"
dish
"
}
}
const
zIndexMap
=
{
...
...
@@ -323,15 +327,48 @@ export class PlayComponent implements OnInit, OnDestroy {
// 卡片容器(盘子 桌布)
initCardContainer
(){
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
'
card-container
'
,
"
dish
"
,
(
w
,
h
)
=>
{
let
pos
=
{
image
:
""
,
x
:
0
,
y
:
0
,
sx
:
0
,
sy
:
0
}
switch
(
this
.
g_formData
.
cardContainerSetting
.
type
){
case
"
A
"
:
pos
.
image
=
"
dish
"
;
pos
.
x
=
this
.
g_canvasWidth
/
2
;
pos
.
y
=
481
*
this
.
g_mapScale
;
pos
.
sx
=
658
*
this
.
g_mapScale
;
pos
.
sy
=
228
*
this
.
g_mapScale
;
break
;
case
"
B
"
:
pos
.
image
=
"
box
"
;
pos
.
x
=
this
.
g_canvasWidth
/
2
;
pos
.
y
=
440
*
this
.
g_mapScale
;
pos
.
sx
=
771
*
this
.
g_mapScale
*
0.8
;
pos
.
sy
=
282
*
this
.
g_mapScale
*
0.8
;
break
;
case
"
C
"
:
pos
.
image
=
"
tablecloth
"
;
pos
.
x
=
this
.
g_canvasWidth
/
2
;
pos
.
y
=
490
*
this
.
g_mapScale
;
pos
.
sx
=
918
*
this
.
g_mapScale
;
pos
.
sy
=
228
*
this
.
g_mapScale
;
break
;
default
:
pos
.
image
=
this
.
g_formData
.
cardContainerSetting
.
image_url
?
this
.
g_formData
.
cardContainerSetting
.
image_url
:
"
dish
"
;
pos
.
x
=
this
.
g_canvasWidth
/
2
;
pos
.
y
=
481
*
this
.
g_mapScale
;
pos
.
sx
=
658
*
this
.
g_mapScale
;
pos
.
sy
=
228
*
this
.
g_mapScale
;
break
;
}
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
'
card-container
'
,
pos
.
image
,
(
w
,
h
)
=>
{
return
{
sx
:
658
*
this
.
g_mapScale
/
w
,
sy
:
228
*
this
.
g_mapScale
/
h
sx
:
pos
.
sx
/
w
,
sy
:
pos
.
sy
/
h
}
},
(
w
,
h
)
=>
{
return
{
x
:
this
.
g_canvasWidth
/
2
,
y
:
this
.
g_cartoon
.
getOrigin
().
y
+
(
h
/
2
)
*
this
.
g_mapScale
+
481
*
this
.
g_mapScale
x
:
pos
.
x
,
y
:
this
.
g_cartoon
.
getOrigin
().
y
+
(
h
/
2
)
*
this
.
g_mapScale
+
pos
.
y
}
})
this
.
render
(
element
.
ref
)
...
...
@@ -500,7 +537,7 @@ export class PlayComponent implements OnInit, OnDestroy {
cardContent
.
ref
.
addChild
(
textContent
)
}
else
{
let
imageContent
=
new
MySprite
()
imageContent
.
init
(
this
.
g_cartoon
.
images
.
get
(
data
.
image_url
?
data
.
image_url
:
"
apple-demp
"
))
imageContent
.
init
(
this
.
g_cartoon
.
images
.
get
(
data
.
image_url
?
data
.
image_url
:
"
_noImage
"
))
imageContent
.
setScaleXY
(
Math
.
min
(
120
/
imageContent
.
width
,
120
/
imageContent
.
height
))
cardContent
.
ref
.
addChild
(
imageContent
)
}
...
...
@@ -692,6 +729,13 @@ export class PlayComponent implements OnInit, OnDestroy {
// 已选择卡片放置点
initSelectedCardArea
(){
let
totalLightCount
=
Math
.
floor
(
this
.
g_canvasWidth
/
(
190
*
this
.
g_mapScale
))
-
1
let
baseLine
=
null
;
switch
(
this
.
g_formData
.
cardContainerSetting
.
type
){
case
"
A
"
:
baseLine
=
165
*
this
.
g_mapScale
;
break
;
case
"
B
"
:
baseLine
=
125
*
this
.
g_mapScale
;
break
;
case
"
C
"
:
baseLine
=
165
*
this
.
g_mapScale
;
break
;
default
:
baseLine
=
165
*
this
.
g_mapScale
;
}
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`selected-card-hotzone`
,
"
bg_1280_180
"
,
(
w
,
h
)
=>
{
return
{
sx
:
1
,
//this.g_canvasWidth/w,
...
...
@@ -700,7 +744,7 @@ export class PlayComponent implements OnInit, OnDestroy {
},
(
w
,
h
)
=>
{
return
{
x
:
this
.
g_canvasWidth
/
2
,
y
:
this
.
g_canvasHeight
/
2
+
165
*
this
.
g_mapScal
e
y
:
this
.
g_canvasHeight
/
2
+
baseLin
e
}
})
element
.
ref
.
alpha
=
0
;
...
...
src/app/play/resources.js
View file @
240de8dc
...
...
@@ -24,6 +24,7 @@ const localImages = {
'
_sm-pic-4
'
:
'
assets/default/images/sm-pic-4.png
'
,
'
_star
'
:
'
assets/default/images/star.png
'
,
'
_bubble
'
:
'
assets/default/images/bubble.png
'
,
'
_image_none
'
:
'
assets/default/images/image_none.png
'
,
'
bg-background
'
:
'
assets/play/bg-background.png
'
,
'
box
'
:
'
assets/play/box.png
'
,
...
...
@@ -42,7 +43,8 @@ const localImages = {
'
text_container
'
:
'
assets/play/text_container-1.png
'
,
'
bg_selected_card
'
:
'
assets/play/bg_selected_card.png
'
,
'
bg_1280_180
'
:
'
assets/play/bg_1280_180_1.png
'
,
'
bee-demo
'
:
'
assets/play/bee-demo.jpg
'
'
bee-demo
'
:
'
assets/play/bee-demo.jpg
'
,
'
tablecloth
'
:
'
assets/play/tablecloth.png
'
};
...
...
src/assets/default/images/_XnoImage.png
0 → 100644
View file @
240de8dc
28.2 KB
src/assets/default/images/image_none.png
0 → 100644
View file @
240de8dc
8.75 KB
src/assets/play/tablecloth.png
0 → 100644
View file @
240de8dc
169 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