Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
Book_Read
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
Book_Read
Commits
80702be7
Commit
80702be7
authored
Nov 11, 2021
by
huoshizhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 点击暂停图标时可以暂停
parent
f40982b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
215 additions
and
40 deletions
+215
-40
hitItem.prefab
play/assets/Book_Read/prefab/hitItem.prefab
+207
-37
Book_Read.js
play/assets/Book_Read/scene/Book_Read.js
+5
-2
picNode.js
play/assets/Book_Read/scene/picNode.js
+3
-1
No files found.
play/assets/Book_Read/prefab/hitItem.prefab
View file @
80702be7
...
...
@@ -33,23 +33,23 @@
"__id__": 20
},
{
"__id__": 2
4
"__id__": 2
6
},
{
"__id__":
28
"__id__":
32
},
{
"__id__": 3
2
"__id__": 3
6
}
],
"_active": true,
"_components": [
{
"__id__": 4
3
"__id__": 4
7
}
],
"_prefab": {
"__id__": 4
4
"__id__": 4
8
},
"_opacity": 255,
"_color": {
...
...
@@ -738,10 +738,13 @@
},
{
"__id__": 22
},
{
"__id__": 23
}
],
"_prefab": {
"__id__": 2
3
"__id__": 2
5
},
"_opacity": 255,
"_color": {
...
...
@@ -849,6 +852,88 @@
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 24
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "57f79KAb0tNU7HjHMpUOk2e",
"handler": "onTouchStart",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
...
...
@@ -871,14 +956,17 @@
"_active": false,
"_components": [
{
"__id__": 2
5
"__id__": 2
7
},
{
"__id__": 26
"__id__": 28
},
{
"__id__": 29
}
],
"_prefab": {
"__id__":
27
"__id__":
31
},
"_opacity": 255,
"_color": {
...
...
@@ -932,7 +1020,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
4
"__id__": 2
6
},
"_enabled": true,
"_materials": [
...
...
@@ -964,7 +1052,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
4
"__id__": 2
6
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -986,6 +1074,88 @@
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 30
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "57f79KAb0tNU7HjHMpUOk2e",
"handler": "onTouchStart",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
...
...
@@ -1008,14 +1178,14 @@
"_active": false,
"_components": [
{
"__id__":
29
"__id__":
33
},
{
"__id__": 3
0
"__id__": 3
4
}
],
"_prefab": {
"__id__": 3
1
"__id__": 3
5
},
"_opacity": 255,
"_color": {
...
...
@@ -1069,7 +1239,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
32
},
"_enabled": true,
"_materials": [
...
...
@@ -1101,7 +1271,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
32
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1143,26 +1313,26 @@
},
"_children": [
{
"__id__": 3
3
"__id__": 3
7
},
{
"__id__":
36
"__id__":
40
}
],
"_active": true,
"_components": [
{
"__id__":
39
"__id__":
43
},
{
"__id__": 4
0
"__id__": 4
4
},
{
"__id__": 4
1
"__id__": 4
5
}
],
"_prefab": {
"__id__": 4
2
"__id__": 4
6
},
"_opacity": 255,
"_color": {
...
...
@@ -1216,17 +1386,17 @@
"_name": "icon_dian",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
6
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 3
4
"__id__": 3
8
}
],
"_prefab": {
"__id__": 3
5
"__id__": 3
9
},
"_opacity": 255,
"_color": {
...
...
@@ -1280,7 +1450,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
3
"__id__": 3
7
},
"_enabled": true,
"_materials": [
...
...
@@ -1323,17 +1493,17 @@
"_name": "icon_hand",
"_objFlags": 0,
"_parent": {
"__id__": 3
2
"__id__": 3
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
37
"__id__":
41
}
],
"_prefab": {
"__id__":
38
"__id__":
42
},
"_opacity": 255,
"_color": {
...
...
@@ -1387,7 +1557,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
36
"__id__":
40
},
"_enabled": true,
"_materials": [
...
...
@@ -1430,7 +1600,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
2
"__id__": 3
6
},
"_enabled": false,
"_defaultClip": {
...
...
@@ -1449,7 +1619,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
2
"__id__": 3
6
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1476,7 +1646,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
2
"__id__": 3
6
},
"_enabled": true,
"_id": ""
...
...
@@ -1501,16 +1671,16 @@
},
"_enabled": true,
"quan": {
"__id__":
28
"__id__":
32
},
"tipsAnim": {
"__id__": 4
},
"handAnim": {
"__id__":
39
"__id__":
43
},
"hand": {
"__id__": 3
2
"__id__": 3
6
},
"sprite": {
"__id__": 12
...
...
@@ -1525,7 +1695,7 @@
"__id__": 20
},
"icon_stop": {
"__id__": 2
4
"__id__": 2
6
},
"quan_lan": {
"__uuid__": "7651dd7c-f921-4f71-8006-4f25714d24b9"
...
...
play/assets/Book_Read/scene/Book_Read.js
View file @
80702be7
...
...
@@ -132,6 +132,7 @@ cc.Class({
getDefaultData
()
{
const
dataJson
=
'
[{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/a962378295f3deb54e9f9329d59aa909.jpg","rect":{"x":427.1,"y":0,"width":1534.81,"height":892}},"hotZoneItemArr":[{"id":"1634813643232","index":0,"audio_url":"http://staging-teach.cdn.ireadabc.com/0b42398a12e1b2f075e9965e4d608765.mp3","itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":108.92,"y":450.35,"width":290.08,"height":290.08}},{"id":"1634813702995","index":1,"itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":493.28,"y":408.29,"width":290.08,"height":290.08}},{"id":"1634813712642","index":2,"audio_url":"http://staging-teach.cdn.ireadabc.com/784cd4188bf126d6c3c9395d9a807619.mp3","itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":789.18,"y":469.21,"width":290.08,"height":290.08}}]},{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/281406244e10356325f075522f016ceb.jpg","rect":{"x":427.1,"y":0,"width":1534.81,"height":892}},"hotZoneItemArr":[{"id":"1634813750668","index":0,"itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":637.6,"y":419.17,"width":100.08,"height":100.08}},{"id":"1634813772152","index":1,"itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":791.35,"y":398.86,"width":85.57,"height":85.57}},{"id":"1634813784384","index":2,"itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":898.68,"y":374.21,"width":82.67,"height":82.67}},{"id":"1634813800497","index":3,"itemType":"rect","fontScale":1.86640625,"imgScale":1,"mapScale":1.86640625,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":1030.67,"y":342.3,"width":73.97,"height":73.97}}]},{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/562f741288227a9a36a7ce63a152278e.jpg","rect":{"x":288.4,"y":0,"width":1058.19,"height":615}},"hotZoneItemArr":[{"id":"1634813836558","index":0,"audio_url":"http://staging-teach.cdn.ireadabc.com/7c1d1540233b6d050eae8215679104a8.mp3","itemType":"rect","fontScale":1.27734375,"imgScale":1,"mapScale":1.27734375,"gIdx":"1","useHand":true,"useBorder":true,"rect":{"x":9.6,"y":305,"width":69,"height":69}},{"id":"1634813857964","index":1,"audio_url":"http://staging-teach.cdn.ireadabc.com/495324991838775e49e3ca6593d432c9.mp3","itemType":"rect","fontScale":1.27734375,"imgScale":1,"mapScale":1.27734375,"gIdx":"1","useHand":true,"useBorder":true,"rect":{"x":115.6,"y":303,"width":67,"height":67}},{"id":"1634813868736","index":2,"audio_url":"http://staging-teach.cdn.ireadabc.com/3d0fea61d5d97f3caf04a9b738a0291b.mp3","itemType":"rect","fontScale":1.27734375,"imgScale":1,"mapScale":1.27734375,"gIdx":"1","useHand":true,"useBorder":true,"rect":{"x":209.6,"y":290,"width":65,"height":65}}]}]
'
// const dataJson = '[{"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/35bfd1d1342e1f2ea3db408afd072343.jpg","rect":{"x":651.79,"y":0,"width":471.43,"height":660}},"hotZoneItemArr":[{"id":"1636511068807","index":0,"audio_url":"http://staging-teach.cdn.ireadabc.com/989f78ee25c48624047f9f0275eb4193.mp3","itemType":"rect","fontScale":1.38671875,"imgScale":1,"mapScale":1.38671875,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":89.71,"y":329,"width":130,"height":130}},{"id":"1636536972082","index":1,"audio_url":"http://staging-teach.cdn.ireadabc.com/3e5c5d427828a8d65bf3f980e954da0c.mp3","itemType":"rect","fontScale":1.38671875,"imgScale":1,"mapScale":1.38671875,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":275.71,"y":370,"width":200,"height":200}},{"id":"1636536992261","index":2,"audio_url":"http://staging-teach.cdn.ireadabc.com/130feba39f7665f46adfc6765f86c6cd.mp3","itemType":"rect","fontScale":1.38671875,"imgScale":1,"mapScale":1.38671875,"gIdx":"0","useHand":true,"useBorder":true,"rect":{"x":135.71,"y":230,"width":200,"height":200}}]}]'
const
data
=
JSON
.
parse
(
dataJson
);
return
data
;
},
...
...
@@ -283,13 +284,15 @@ cc.Class({
this
.
isPlaying
=
true
;
let
btn_loop
=
this
.
btn_audio
.
getComponent
(
"
btn_loop
"
);
//找到btn_loop
btn_loop
.
startPlay
();
//执行播放的方法
this
.
picNode
.
getComponent
(
'
picNode
'
).
autoTouchAll
()
// this.picNode.getComponent('picNode').autoTouchAll()
},
stopAll
()
{
this
.
isPlaying
=
false
;
let
btn_loop
=
this
.
btn_audio
.
getComponent
(
"
btn_loop
"
);
//找到btn_loop
btn_loop
.
stopPlay
();
//执行暂停的方法
this
.
picNode
.
getComponent
(
'
picNode
'
).
stopTouchAll
()
// this.picNode.getComponent('picNode').stopTouchAll()
},
/** 左移动 */
leftMove
()
{
...
...
play/assets/Book_Read/scene/picNode.js
View file @
80702be7
...
...
@@ -66,7 +66,9 @@ cc.Class({
if
(
!
this
.
autoPlay
)
{
this
.
autoPlay
=
true
;
this
.
items
=
this
.
_items
.
children
;
this
.
count
=
0
;
if
(
this
.
count
===
undefined
)
{
this
.
count
=
0
;
}
this
.
play
();
}
},
...
...
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