Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_pageturn
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_pageturn
Commits
1cc8f2b4
Commit
1cc8f2b4
authored
Dec 01, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取骨骼真实大小
parent
f0844c8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
ItemPage.prefab
play/assets/tmpGame/prefabs/ItemPage.prefab
+1
-0
ItemPage.js
play/assets/tmpGame/script/ItemPage.js
+11
-5
Scene.js
play/assets/tmpGame/script/Scene.js
+1
-1
No files found.
play/assets/tmpGame/prefabs/ItemPage.prefab
View file @
1cc8f2b4
...
...
@@ -562,6 +562,7 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": true,
"_string": "",
"_N$string": "",
"_fontSize": 42,
...
...
play/assets/tmpGame/script/ItemPage.js
View file @
1cc8f2b4
...
...
@@ -74,6 +74,10 @@ cc.Class({
// imageUrl = 'http://127.0.0.1/walkingfish_tex.png';
// skeUrl = 'http://127.0.0.1/walkingfish_ske.json';
// atlasUrl = 'http://127.0.0.1/walkingfish_tex.json';
// imageUrl = 'http://127.0.0.1/B1U5L3_page1_ani_tex.png';
// skeUrl = 'http://127.0.0.1/B1U5L3_page1_ani_ske.json';
// atlasUrl = 'http://127.0.0.1/B1U5L3_page1_ani_tex.json';
cc
.
assetManager
.
loadAny
([{
url
:
atlasUrl
,
ext
:
'
.txt
'
},
{
url
:
skeUrl
,
ext
:
'
.txt
'
}],
(
error
,
assets
)
=>
{
if
(
error
)
{
console
.
log
(
error
)
...
...
@@ -101,6 +105,8 @@ cc.Class({
}
this
.
dragonBone
.
armatureName
=
data
.
name
;
this
.
animationName
=
data
.
animation
[
0
].
name
;
this
.
setSpineScale
(
data
.
canvas
);
}
});
}
...
...
@@ -125,19 +131,19 @@ cc.Class({
}
}
},
setSpineScale
()
{
setSpineScale
(
size
)
{
let
bgWidth
=
1000
;
let
bgHeight
=
500
;
if
(
!
this
.
data
.
text
)
{
bgHeight
=
546
;
}
if
(
this
.
dragonBone
.
node
.
width
!=
bgWidth
||
this
.
dragonBone
.
nod
e
.
height
!=
bgHeight
)
{
if
(
size
.
width
!=
bgWidth
||
siz
e
.
height
!=
bgHeight
)
{
let
designScale
=
bgWidth
/
bgHeight
;
let
scale
=
this
.
dragonBone
.
node
.
width
/
this
.
dragonBone
.
nod
e
.
height
;
let
scale
=
size
.
width
/
siz
e
.
height
;
if
(
scale
>
designScale
)
{
this
.
dragonBone
.
node
.
scale
=
bgWidth
/
this
.
dragonBone
.
nod
e
.
width
;
this
.
dragonBone
.
node
.
scale
=
bgWidth
/
siz
e
.
width
;
}
else
{
this
.
dragonBone
.
node
.
scale
=
bgHeight
/
this
.
dragonBone
.
nod
e
.
height
;
this
.
dragonBone
.
node
.
scale
=
bgHeight
/
siz
e
.
height
;
}
}
},
...
...
play/assets/tmpGame/script/Scene.js
View file @
1cc8f2b4
...
...
@@ -138,7 +138,7 @@ cc.Class({
},
getDefaultData
()
{
const
dataJson
=
'
{"contentObj":{"version":"1.1","key":"DataKey_Cocos_Test","haveCover":true,"dataArray":[{"type":"
Imag
e","text":"没 有 数 据","image_url":""},{"type":"Spine","text":"没 有 数 据","image_url":""}]}}
'
const
dataJson
=
'
{"contentObj":{"version":"1.1","key":"DataKey_Cocos_Test","haveCover":true,"dataArray":[{"type":"
Spin
e","text":"没 有 数 据","image_url":""},{"type":"Spine","text":"没 有 数 据","image_url":""}]}}
'
const
data
=
JSON
.
parse
(
dataJson
);
return
data
;
},
...
...
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