Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_Pronunciation
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
Sbx_Pronunciation
Commits
d88b8114
Commit
d88b8114
authored
Dec 09, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test on platform
parent
c6ce2c37
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
161 additions
and
4 deletions
+161
-4
demoText.meta
play/assets/tmpGame/dragonBones/demoText.meta
+12
-0
Scene.js
play/assets/tmpGame/script/Scene.js
+2
-2
build.js
publish/build.js
+4
-0
index.html
publish/index.html
+2
-2
main.js
publish/main.js
+141
-0
No files found.
play/assets/tmpGame/dragonBones/demoText.meta
0 → 100644
View file @
d88b8114
{
"ver": "1.1.2",
"uuid": "0149e220-5577-4f0a-8c6c-4225bd703c54",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/script/Scene.js
View file @
d88b8114
...
...
@@ -104,8 +104,8 @@ cc.Class({
// const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbx_Pronunciation","bgMusic":"","titleText":"TEstd","questionAudio_url":"","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/06cc843598a912921f6ca3acfde6220b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/571974922f6678111348a5643dba7e20.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/78579114773af12a7aec6723e3b9d475.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/c99e82e1c3f087c6dc0469e30c624f70.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/5b45c89ac9e899d76522767219b1346b.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/2e28eae8f0e0f01193da6f3677379ed3.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/fad2dac4f8b59a185dc30d42617c2ca8.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/6c3fca11052464102407f173e4a83db9.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ec82c796af801486548ae98623f614d2.png"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ac4b9422df1556f80ac5c3058cd3d670.png"}]}}'
// const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbx_Pronunciation","bgMusic":"http://staging-teach.cdn.ireadabc.com/ad58bae62ea02cf215ce7dee22df306f.mp3","titleText":"TEstd","questionAudio_url":"http://staging-teach.cdn.ireadabc.com/2bf96923b83ee0c5f20930386ce07384.mp3","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/06cc843598a912921f6ca3acfde6220b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/571974922f6678111348a5643dba7e20.png","audio_url":"http://staging-teach.cdn.ireadabc.com/ae7c0930a45d0ffc9f13182298e2be71.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/78579114773af12a7aec6723e3b9d475.png","audio_url":"http://staging-teach.cdn.ireadabc.com/c14938125a52096dc0be9fbbf6638cb2.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/c99e82e1c3f087c6dc0469e30c624f70.png","audio_url":"http://staging-teach.cdn.ireadabc.com/135c628899396df62c14567f46d61f3f.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/5b45c89ac9e899d76522767219b1346b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/2e28eae8f0e0f01193da6f3677379ed3.png","audio_url":"http://staging-teach.cdn.ireadabc.com/cb0ac1d1bcdfdaf768f0a06d3fff37a3.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/fad2dac4f8b59a185dc30d42617c2ca8.png","audio_url":"http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/6c3fca11052464102407f173e4a83db9.png","audio_url":"http://staging-teach.cdn.ireadabc.com/d5a5ac2f45431a8a15492cb9f78e0396.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ec82c796af801486548ae98623f614d2.png","audio_url":"http://staging-teach.cdn.ireadabc.com/fb08783926362bf64232e2ec6966011d.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/ac4b9422df1556f80ac5c3058cd3d670.png","audio_url":"http://staging-teach.cdn.ireadabc.com/fb08783926362bf64232e2ec6966011d.mp3"}]}}'
// const dataJson = '{"contentObj":{"version":"1.0","key":"DataKey_Sbx_Pronunciation","bgMusic":"http://staging-teach.cdn.ireadabc.com/2bf96923b83ee0c5f20930386ce07384.mp3","titleText":"TEstd","questionAudio_url":"http://staging-teach.cdn.ireadabc.com/2bf96923b83ee0c5f20930386ce07384.mp3","dataArray":[{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/06cc843598a912921f6ca3acfde6220b.png","audio_url":"http://staging-teach.cdn.ireadabc.com/3b5540cc95a006dff8c41dba7537075a.mp3"},{"text":"","image_url":"http://staging-teach.cdn.ireadabc.com/571974922f6678111348a5643dba7e20.png","audio_url":"http://staging-teach.cdn.ireadabc.com/ae7c0930a45d0ffc9f13182298e2be71.mp3"}]}}'
const
dataJson
=
'
{ "contentObj": { "version": "1.0", "key": "DataKey_Sbx_Pronunciation", "theme": "D", "border_image_url": "http://staging-teach.cdn.ireadabc.com/c3e8520418444ad2ee7689510f98de9b.png", "video_image_url": "http://staging-teach.cdn.ireadabc.com/06bb65fb7a3a03d095587b5cc2efc65f.png", "text_image_url": "http://staging-teach.cdn.ireadabc.com/08a2a49e8e1e8e1dc53fb57ad8a4cb44.png", "dataArray": [ { "video_url": "http://staging-teach.cdn.ireadabc.com/f25bb33cdb266345667a1bec58818175.mp4", "textDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } }, "rightDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } } }, { "video_url": "http://staging-teach.cdn.ireadabc.com/82438e44e9e106cfa43d1fd62a24d61b.mp4", "textDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } }, "rightDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } } } ] } }
'
//
const dataJson = '{ "contentObj": { "version": "1.0", "key": "DataKey_Sbx_Pronunciation", "bgMusic": "", "titleText": "", "questionAudio_url": "", "birdDragonBones_1": {}, "birdDragonBones_2": {}, "birdDragonBones_audio": {}, "dataArray": [], "theme": "A" }, "border_image_url": "", "video_image_url": "", "text_image_url": "" }'
//
const dataJson = '{ "contentObj": { "version": "1.0", "key": "DataKey_Sbx_Pronunciation", "theme": "D", "border_image_url": "http://staging-teach.cdn.ireadabc.com/c3e8520418444ad2ee7689510f98de9b.png", "video_image_url": "http://staging-teach.cdn.ireadabc.com/06bb65fb7a3a03d095587b5cc2efc65f.png", "text_image_url": "http://staging-teach.cdn.ireadabc.com/08a2a49e8e1e8e1dc53fb57ad8a4cb44.png", "dataArray": [ { "video_url": "http://staging-teach.cdn.ireadabc.com/f25bb33cdb266345667a1bec58818175.mp4", "textDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } }, "rightDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } } }, { "video_url": "http://staging-teach.cdn.ireadabc.com/82438e44e9e106cfa43d1fd62a24d61b.mp4", "textDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } }, "rightDragonBones": { "skeJsonData": { "url": "", "name": "" }, "texJsonData": { "url": "", "name": "" }, "texPngData": { "url": "", "name": "" } } } ] } }'
const
dataJson
=
'
{ "contentObj": { "version": "1.0", "key": "DataKey_Sbx_Pronunciation", "bgMusic": "", "titleText": "", "questionAudio_url": "", "birdDragonBones_1": {}, "birdDragonBones_2": {}, "birdDragonBones_audio": {}, "dataArray": [], "theme": "A" }, "border_image_url": "", "video_image_url": "", "text_image_url": "" }
'
const
data
=
JSON
.
parse
(
dataJson
);
return
data
;
},
...
...
publish/build.js
View file @
d88b8114
...
...
@@ -68,6 +68,10 @@ async function main() {
const
data
=
await
fs
.
readFileSync
(
'
./index.html
'
);
await
fs
.
writeFileSync
(
'
./publish/play/index.html
'
,
data
);
// special for Sbx_Pronunciation
const
mainJS
=
await
fs
.
readFileSync
(
'
./main.js
'
);
await
fs
.
writeFileSync
(
'
./publish/play/main.js
'
,
mainJS
);
compressing
.
zip
.
uncompress
(
'
../form/publish/form.zip
'
,
'
./publish/form
'
)
.
then
(()
=>
{
const
tarStream
=
new
compressing
.
zip
.
Stream
();
...
...
publish/index.html
View file @
d88b8114
...
...
@@ -34,8 +34,8 @@
<!-- <p class="footer">Made with <a href="https://www.cocos.com/products#CocosCreator" title="cocos creator">Cocos Creator</a></p> -->
<script
src=
"src/settings.js"
charset=
"utf-8"
></script>
<
!-- <script src="main.js" charset="utf-8"></script> --
>
<
script
src=
"http://www.datalist.com.cn/vender/javascript/cocos/main.js"
charset=
"utf-8"
></script
>
<
script
src=
"main.js"
charset=
"utf-8"
></script
>
<
!-- <script src="http://www.datalist.com.cn/vender/javascript/cocos/main.js" charset="utf-8"></script> --
>
<script
type=
"text/javascript"
src=
"https://staging-teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"
></script>
...
...
publish/main.js
0 → 100644
View file @
d88b8114
window
.
boot
=
function
()
{
var
settings
=
window
.
_CCSettings
;
window
.
_CCSettings
=
undefined
;
var
onProgress
=
null
;
let
{
RESOURCES
,
INTERNAL
,
MAIN
,
START_SCENE
}
=
cc
.
AssetManager
.
BuiltinBundleName
;
function
setLoadingDisplay
()
{
// Loading splash scene
var
splash
=
document
.
getElementById
(
'
splash
'
);
var
progressBar
=
splash
.
querySelector
(
'
.progress-bar span
'
);
onProgress
=
function
(
finish
,
total
)
{
var
percent
=
100
*
finish
/
total
;
if
(
progressBar
)
{
progressBar
.
style
.
width
=
percent
.
toFixed
(
2
)
+
'
%
'
;
}
};
splash
.
style
.
display
=
'
block
'
;
progressBar
.
style
.
width
=
'
0%
'
;
cc
.
director
.
once
(
cc
.
Director
.
EVENT_AFTER_SCENE_LAUNCH
,
function
()
{
splash
.
style
.
display
=
'
none
'
;
});
}
var
onStart
=
function
()
{
cc
.
view
.
enableRetina
(
true
);
cc
.
view
.
resizeWithBrowserSize
(
true
);
if
(
cc
.
sys
.
isBrowser
)
{
setLoadingDisplay
();
}
if
(
cc
.
sys
.
isMobile
)
{
if
(
settings
.
orientation
===
'
landscape
'
)
{
cc
.
view
.
setOrientation
(
cc
.
macro
.
ORIENTATION_LANDSCAPE
);
}
else
if
(
settings
.
orientation
===
'
portrait
'
)
{
cc
.
view
.
setOrientation
(
cc
.
macro
.
ORIENTATION_PORTRAIT
);
}
cc
.
view
.
enableAutoFullScreen
([
cc
.
sys
.
BROWSER_TYPE_BAIDU
,
cc
.
sys
.
BROWSER_TYPE_BAIDU_APP
,
cc
.
sys
.
BROWSER_TYPE_WECHAT
,
cc
.
sys
.
BROWSER_TYPE_MOBILE_QQ
,
cc
.
sys
.
BROWSER_TYPE_MIUI
,
].
indexOf
(
cc
.
sys
.
browserType
)
<
0
);
}
// Limit downloading max concurrent task to 2,
// more tasks simultaneously may cause performance draw back on some android system / browsers.
// You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
if
(
cc
.
sys
.
isBrowser
&&
cc
.
sys
.
os
===
cc
.
sys
.
OS_ANDROID
)
{
cc
.
assetManager
.
downloader
.
maxConcurrency
=
2
;
cc
.
assetManager
.
downloader
.
maxRequestsPerFrame
=
2
;
}
var
launchScene
=
settings
.
launchScene
;
var
bundle
=
cc
.
assetManager
.
bundles
.
find
(
function
(
b
)
{
return
b
.
getSceneInfo
(
launchScene
);
});
bundle
.
loadScene
(
launchScene
,
null
,
onProgress
,
function
(
err
,
scene
)
{
if
(
!
err
)
{
cc
.
director
.
runSceneImmediate
(
scene
);
if
(
cc
.
sys
.
isBrowser
)
{
// show canvas
var
canvas
=
document
.
getElementById
(
'
GameCanvas
'
);
canvas
.
style
.
visibility
=
''
;
var
div
=
document
.
getElementById
(
'
GameDiv
'
);
if
(
div
)
{
div
.
style
.
backgroundImage
=
''
;
}
console
.
log
(
'
Success to load scene:
'
+
launchScene
);
}
}
}
);
};
var
option
=
{
id
:
'
GameCanvas
'
,
debugMode
:
settings
.
debug
?
cc
.
debug
.
DebugMode
.
INFO
:
cc
.
debug
.
DebugMode
.
ERROR
,
showFPS
:
settings
.
debug
,
frameRate
:
60
,
groupList
:
settings
.
groupList
,
collisionMatrix
:
settings
.
collisionMatrix
,
};
cc
.
assetManager
.
init
({
bundleVers
:
settings
.
bundleVers
,
remoteBundles
:
settings
.
remoteBundles
,
server
:
settings
.
server
});
let
bundleRoot
=
[
INTERNAL
,
MAIN
];
settings
.
hasStartSceneBundle
&&
bundleRoot
.
push
(
START_SCENE
);
settings
.
hasResourcesBundle
&&
bundleRoot
.
push
(
RESOURCES
);
var
count
=
0
;
function
cb
(
err
)
{
if
(
err
)
return
console
.
error
(
err
.
message
,
err
.
stack
);
count
++
;
if
(
count
===
bundleRoot
.
length
+
1
)
{
cc
.
macro
.
ENABLE_TRANSPARENT_CANVAS
=
true
;
cc
.
director
.
setClearColor
(
cc
.
color
(
255
,
255
,
255
,
0
));
cc
.
game
.
run
(
option
,
onStart
);
}
}
cc
.
assetManager
.
loadScript
(
settings
.
jsList
.
map
(
function
(
x
)
{
return
'
src/
'
+
x
;}),
cb
);
for
(
let
i
=
0
;
i
<
bundleRoot
.
length
;
i
++
)
{
cc
.
assetManager
.
loadBundle
(
bundleRoot
[
i
],
cb
);
}
};
if
(
window
.
jsb
)
{
var
isRuntime
=
(
typeof
loadRuntime
===
'
function
'
);
if
(
isRuntime
)
{
require
(
'
src/settings.js
'
);
require
(
'
src/cocos2d-runtime.js
'
);
if
(
CC_PHYSICS_BUILTIN
||
CC_PHYSICS_CANNON
)
{
require
(
'
src/physics.js
'
);
}
require
(
'
jsb-adapter/engine/index.js
'
);
}
else
{
require
(
'
src/settings.js
'
);
require
(
'
src/cocos2d-jsb.js
'
);
if
(
CC_PHYSICS_BUILTIN
||
CC_PHYSICS_CANNON
)
{
require
(
'
src/physics.js
'
);
}
require
(
'
jsb-adapter/jsb-engine.js
'
);
}
cc
.
macro
.
CLEANUP_IMAGE_CACHE
=
true
;
window
.
boot
();
}
\ 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