Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xy_camera
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
xy_camera
Commits
73ff5aa0
Commit
73ff5aa0
authored
Aug 15, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 结束播放动画并自动翻页
parent
77083b4c
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
3593 additions
and
2040 deletions
+3593
-2040
xy_camera.fire
assets/xy_camera/scene/xy_camera.fire
+3301
-2023
xy_camera.ts
assets/xy_camera/scene/xy_camera.ts
+63
-10
defaultData.ts
assets/xy_camera/script/defaultData.ts
+46
-4
bg.png
assets/xy_camera/textures/bg.png
+0
-0
bg.png.meta
assets/xy_camera/textures/bg.png.meta
+3
-3
bg_bg.png
assets/xy_camera/textures/bg_bg.png
+0
-0
bg_bg.png.meta
assets/xy_camera/textures/bg_bg.png.meta
+36
-0
final_title.png
assets/xy_camera/textures/final_title.png
+0
-0
final_title.png.meta
assets/xy_camera/textures/final_title.png.meta
+36
-0
headbg.png
assets/xy_camera/textures/headbg.png
+0
-0
headbg.png.meta
assets/xy_camera/textures/headbg.png.meta
+36
-0
sure.png
assets/xy_camera/textures/sure.png
+0
-0
sure.png.meta
assets/xy_camera/textures/sure.png.meta
+36
-0
sure_diss.png
assets/xy_camera/textures/sure_diss.png
+0
-0
sure_diss.png.meta
assets/xy_camera/textures/sure_diss.png.meta
+36
-0
No files found.
assets/xy_camera/scene/xy_camera.fire
View file @
73ff5aa0
This diff is collapsed.
Click to expand it.
assets/xy_camera/scene/xy_camera.ts
View file @
73ff5aa0
import
{
buttonOnClick
,
buttonOnceClick
,
getSpriteFrimeByUrl
}
from
"
../script/util
"
;
import
{
buttonOnClick
,
buttonOnceClick
,
getSpriteFrimeByUrl
,
asyncLoadDragonBoneAnime
,
asyncDelay
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -28,14 +28,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
isOver
=
false
;
asyncDrawAnswer
()
{
console
.
log
(
"
1111111111111111111111
"
);
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
window
&&
window
[
"
courseware
"
])
{
console
.
log
(
"
222222222222222222
"
);
window
[
"
courseware
"
].
getAnswer
(
null
,
(
ans
)
=>
{
console
.
log
(
'
-----------------
'
);
console
.
log
(
ans
);
console
.
log
(
'
-----------------
'
);
if
(
ans
)
{
this
.
isOver
=
JSON
.
parse
(
ans
).
isOver
;
if
(
this
.
isOver
)
{
...
...
@@ -72,6 +67,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_cantouch
=
true
;
}
picture_url
=
null
;
initView
()
{
this
.
initBg
();
window
[
"
cameraHandler
"
].
takePictureCallback
=
(
err
,
url
)
=>
{
...
...
@@ -80,10 +76,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
hideLoading
();
return
;
}
// 上报答题结果
if
(
window
&&
window
[
"
courseware
"
])
{
window
[
"
courseware
"
].
sendAnswer
({
isOver
:
true
,
pic_url
:
url
});
}
cc
.
find
(
`Canvas/border/sure`
).
active
=
true
;
cc
.
find
(
`Canvas/border/sure_diss`
).
active
=
false
;
this
.
picture_url
=
url
;
const
pic
=
cc
.
find
(
`Canvas/border/pic_bg/picture`
);
getSpriteFrimeByUrl
(
url
,
(
frame
)
=>
{
pic
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
frame
;
...
...
@@ -105,6 +101,63 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
showLoading
();
window
[
"
cameraHandler
"
].
openCamera
();
});
const
sure
=
cc
.
find
(
`Canvas/border/sure`
);
buttonOnClick
(
sure
,
async
()
=>
{
// 上报答题结果
if
(
window
&&
window
[
"
courseware
"
])
{
window
[
"
courseware
"
].
sendAnswer
({
isOver
:
true
,
pic_url
:
this
.
picture_url
});
}
await
this
.
showFinal
();
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
mc
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
// // 切换下一页
mc
.
goNextPage
();
}
else
{
console
.
log
(
"
==切换下一页==
"
);
}
});
}
async
showFinal
()
{
let
final
=
cc
.
find
(
"
final
"
,
this
.
node
);
let
f_group
=
cc
.
find
(
"
f_group
"
,
final
);
f_group
.
scale
=
1
;
f_group
.
setPosition
(
0
,
-
265
);
f_group
.
active
=
true
;
await
asyncLoadDragonBoneAnime
(
f_group
,
{
skeJsonData
:
this
.
data
.
endImgAni
.
ske
,
texJsonData
:
this
.
data
.
endImgAni
.
tex
,
texPngData
:
this
.
data
.
endImgAni
.
png
});
const
animaNode
=
f_group
[
'
animaNode
'
];
const
db
=
animaNode
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
let
anis
=
db
.
getAnimationNames
(
"
armatureName
"
);
db
.
playAnimation
(
anis
[
0
],
0
);
final
.
active
=
true
;
let
desc
=
cc
.
find
(
"
desc
"
,
f_group
);
let
final_title
=
cc
.
find
(
"
final_title
"
,
f_group
);
let
head
=
cc
.
find
(
"
top/player/mask
"
,
this
.
node
);
let
worldPoint
=
head
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
0
));
let
pos
=
final
.
convertToNodeSpaceAR
(
worldPoint
);
desc
.
getComponent
(
cc
.
Label
).
string
=
this
.
data
.
endImgTitle
;
await
asyncDelay
(
2
);
desc
.
active
=
true
;
final_title
.
active
=
true
;
await
asyncDelay
(
1
);
let
sc
=
cc
.
scaleTo
(
0.2
,
0.2
);
var
actionTo
=
cc
.
jumpTo
(
1
,
cc
.
v2
(
pos
.
x
,
pos
.
y
),
300
,
1
);
let
call
=
cc
.
callFunc
(()
=>
{
final
.
active
=
false
;
})
f_group
.
runAction
(
cc
.
sequence
(
sc
,
actionTo
,
call
));
}
playLocalAudio
(
audioName
)
{
...
...
assets/xy_camera/script/defaultData.ts
View file @
73ff5aa0
export
const
defaultData
=
{
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png
"
,
"
pic_url_2
"
:
"
http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png
"
,
"
text
"
:
"
This is a test label.
"
,
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3
"
"
imgAni
"
:
{
"
ske
"
:
{
"
url
"
:
"
https://teach.cdn.ireadabc.com/e13afca23d37ba33489c0aaa61a515f5.json
"
,
"
name
"
:
"
川阅阅_ske.json
"
},
"
tex
"
:
{
"
url
"
:
"
https://teach.cdn.ireadabc.com/7afcddbb7f0127613059e574638a9f3e.json
"
,
"
name
"
:
"
川阅阅_tex.json
"
},
"
png
"
:
{
"
url
"
:
"
https://teach.cdn.ireadabc.com/63699fcef6053eef4f58b89dad35af0b.png
"
,
"
name
"
:
"
川阅阅_tex.png
"
}
},
"
tipSwitch
"
:
"
1
"
,
"
tipType
"
:
"
page
"
,
"
tipBg
"
:
"
https://teach.cdn.ireadabc.com/4516be9212c58098c8eebbd7021c8c2a.png
"
,
"
tipPage
"
:
[
{
"
title
"
:
"
这么小的院子里,居然同时有一间书房和一间书院,这家人可真喜欢读书啊。
"
,
"
audio
"
:
""
}
],
"
title
"
:
""
,
"
audio
"
:
""
,
"
audioName
"
:
""
,
"
image
"
:
"
https://teach.cdn.ireadabc.com/efa8d5d75d18379dcac9ee885d6f2980.png
"
,
"
endImgAni
"
:
{
"
ske
"
:
{
"
url
"
:
"
https://teach.cdn.ireadabc.com/8a5825bc51a32f13ddb55d3065d713a9.json
"
,
"
name
"
:
"
动画用图川阅阅奖励_ske.json
"
},
"
tex
"
:
{
"
url
"
:
"
https://teach.cdn.ireadabc.com/c4f5e10343ab1e79eb7407867fc4a85b.json
"
,
"
name
"
:
"
动画用图川阅阅奖励_tex.json
"
},
"
png
"
:
{
"
url
"
:
"
https://teach.cdn.ireadabc.com/bc984a44b7537f051707f662fba3943e.png
"
,
"
name
"
:
"
动画用图川阅阅奖励_tex.png
"
}
},
"
endImgTitle
"
:
"
棒棒的!
"
,
"
points
"
:
""
,
"
tips
"
:
"
匾额写的是这间屋子的名字或屋子最主要的功能
"
,
"
questionScore
"
:
"
15
"
,
}
\ No newline at end of file
assets/xy_camera/textures/bg.png
View replaced file @
77083b4c
View file @
73ff5aa0
420 KB
|
W:
|
H:
275 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/xy_camera/textures/bg.png.meta
View file @
73ff5aa0
{
"ver": "2.3.5",
"uuid": "9
4d00aab-b23f-45ad-9ab2-57c92ef61efb
",
"uuid": "9
af9993c-cdca-47b5-838c-41ae6f140a1d
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "
124c4033-b4af-4f46-aad7-cfad80e198b2
",
"rawTextureUuid": "9
4d00aab-b23f-45ad-9ab2-57c92ef61efb
",
"uuid": "
c3ed9ee3-2b8e-4a1f-9aee-b136c6b7f55b
",
"rawTextureUuid": "9
af9993c-cdca-47b5-838c-41ae6f140a1d
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/xy_camera/textures/bg_bg.png
0 → 100644
View file @
73ff5aa0
420 KB
assets/xy_camera/textures/bg_bg.png.meta
0 → 100644
View file @
73ff5aa0
{
"ver": "2.3.5",
"uuid": "94d00aab-b23f-45ad-9ab2-57c92ef61efb",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2436,
"height": 1125,
"platformSettings": {},
"subMetas": {
"bg_bg": {
"ver": "1.0.4",
"uuid": "124c4033-b4af-4f46-aad7-cfad80e198b2",
"rawTextureUuid": "94d00aab-b23f-45ad-9ab2-57c92ef61efb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2436,
"height": 1125,
"rawWidth": 2436,
"rawHeight": 1125,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_camera/textures/final_title.png
0 → 100644
View file @
73ff5aa0
30.4 KB
assets/xy_camera/textures/final_title.png.meta
0 → 100644
View file @
73ff5aa0
{
"ver": "2.3.5",
"uuid": "2397c47e-ebaa-41a5-b838-fc509cee3915",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 578,
"height": 133,
"platformSettings": {},
"subMetas": {
"final_title": {
"ver": "1.0.4",
"uuid": "def22327-cd60-4883-95a6-878f74760883",
"rawTextureUuid": "2397c47e-ebaa-41a5-b838-fc509cee3915",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 578,
"height": 133,
"rawWidth": 578,
"rawHeight": 133,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_camera/textures/headbg.png
0 → 100644
View file @
73ff5aa0
6.91 KB
assets/xy_camera/textures/headbg.png.meta
0 → 100644
View file @
73ff5aa0
{
"ver": "2.3.5",
"uuid": "d49a43c8-5b2c-43c9-903a-204a928619fa",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 310,
"height": 117,
"platformSettings": {},
"subMetas": {
"headbg": {
"ver": "1.0.4",
"uuid": "c8eb187b-0d10-4de6-b691-4d99f25e5150",
"rawTextureUuid": "d49a43c8-5b2c-43c9-903a-204a928619fa",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 310,
"height": 117,
"rawWidth": 310,
"rawHeight": 117,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_camera/textures/sure.png
0 → 100644
View file @
73ff5aa0
17.7 KB
assets/xy_camera/textures/sure.png.meta
0 → 100644
View file @
73ff5aa0
{
"ver": "2.3.5",
"uuid": "dfa3a539-c65b-40dc-9f41-1451cdda8f60",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 420,
"height": 240,
"platformSettings": {},
"subMetas": {
"sure": {
"ver": "1.0.4",
"uuid": "4656652a-360a-429a-a312-576a84b18be2",
"rawTextureUuid": "dfa3a539-c65b-40dc-9f41-1451cdda8f60",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -0.5,
"trimX": 6,
"trimY": 9,
"width": 409,
"height": 223,
"rawWidth": 420,
"rawHeight": 240,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/xy_camera/textures/sure_diss.png
0 → 100644
View file @
73ff5aa0
16 KB
assets/xy_camera/textures/sure_diss.png.meta
0 → 100644
View file @
73ff5aa0
{
"ver": "2.3.5",
"uuid": "50b740b4-97fc-42bc-9c2f-d0d32f9ed241",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 420,
"height": 240,
"platformSettings": {},
"subMetas": {
"sure_diss": {
"ver": "1.0.4",
"uuid": "3aff665e-8303-4109-8585-5b12911bc575",
"rawTextureUuid": "50b740b4-97fc-42bc-9c2f-d0d32f9ed241",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": -18.5,
"trimX": 48,
"trimY": 67,
"width": 326,
"height": 143,
"rawWidth": 420,
"rawHeight": 240,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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