mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-05 06:44:56 +08:00
Meshes, FFd and skinning for spine-as3.
This commit is contained in:
parent
01c0e1881f
commit
a80cd047cf
@ -1,285 +1,292 @@
|
||||
|
||||
goblins.png
|
||||
goblins-ffd.png
|
||||
format: RGBA8888
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
spear
|
||||
rotate: false
|
||||
xy: 2, 142
|
||||
size: 22, 368
|
||||
orig: 22, 368
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/head
|
||||
rotate: false
|
||||
xy: 26, 429
|
||||
size: 103, 81
|
||||
orig: 103, 81
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/head
|
||||
rotate: false
|
||||
xy: 26, 361
|
||||
size: 103, 66
|
||||
orig: 103, 66
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/torso
|
||||
rotate: false
|
||||
xy: 131, 414
|
||||
size: 68, 96
|
||||
orig: 68, 96
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/torso
|
||||
rotate: false
|
||||
xy: 26, 263
|
||||
size: 68, 96
|
||||
orig: 68, 96
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
dagger
|
||||
rotate: false
|
||||
xy: 26, 153
|
||||
xy: 2, 28
|
||||
size: 26, 108
|
||||
orig: 26, 108
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-lower-leg
|
||||
rotate: false
|
||||
xy: 201, 434
|
||||
size: 36, 76
|
||||
orig: 36, 76
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-lower-leg
|
||||
rotate: false
|
||||
xy: 54, 185
|
||||
size: 36, 76
|
||||
orig: 36, 76
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-upper-leg
|
||||
rotate: false
|
||||
xy: 96, 286
|
||||
size: 33, 73
|
||||
orig: 33, 73
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/pelvis
|
||||
rotate: false
|
||||
xy: 131, 369
|
||||
size: 62, 43
|
||||
orig: 62, 43
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/pelvis
|
||||
rotate: false
|
||||
xy: 131, 324
|
||||
size: 62, 43
|
||||
orig: 62, 43
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-foot
|
||||
rotate: false
|
||||
xy: 131, 289
|
||||
size: 63, 33
|
||||
orig: 63, 33
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-lower-leg
|
||||
rotate: false
|
||||
xy: 2, 70
|
||||
size: 33, 70
|
||||
orig: 33, 70
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-upper-leg
|
||||
rotate: false
|
||||
xy: 2, 5
|
||||
size: 34, 63
|
||||
orig: 34, 63
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-lower-leg
|
||||
rotate: false
|
||||
xy: 195, 342
|
||||
size: 33, 70
|
||||
orig: 33, 70
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-upper-leg
|
||||
rotate: false
|
||||
xy: 37, 81
|
||||
size: 33, 70
|
||||
orig: 33, 70
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-upper-leg
|
||||
rotate: false
|
||||
xy: 38, 16
|
||||
size: 34, 63
|
||||
orig: 34, 63
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/eyes-closed
|
||||
rotate: false
|
||||
xy: 38, 2
|
||||
xy: 137, 29
|
||||
size: 34, 12
|
||||
orig: 34, 12
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/undies
|
||||
goblin/head
|
||||
rotate: false
|
||||
xy: 54, 154
|
||||
size: 36, 29
|
||||
orig: 36, 29
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-arm
|
||||
rotate: false
|
||||
xy: 72, 102
|
||||
size: 23, 50
|
||||
orig: 23, 50
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-foot
|
||||
rotate: false
|
||||
xy: 131, 256
|
||||
size: 65, 31
|
||||
orig: 65, 31
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-arm
|
||||
rotate: false
|
||||
xy: 196, 290
|
||||
size: 28, 50
|
||||
orig: 28, 50
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-shoulder
|
||||
rotate: false
|
||||
xy: 226, 294
|
||||
size: 28, 46
|
||||
orig: 28, 46
|
||||
xy: 26, 357
|
||||
size: 103, 66
|
||||
orig: 103, 66
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-arm
|
||||
rotate: false
|
||||
xy: 198, 253
|
||||
xy: 30, 28
|
||||
size: 37, 35
|
||||
orig: 37, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-foot
|
||||
rotate: false
|
||||
xy: 134, 260
|
||||
size: 65, 31
|
||||
orig: 65, 31
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-hand
|
||||
rotate: false
|
||||
xy: 69, 25
|
||||
size: 36, 41
|
||||
orig: 36, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-lower-leg
|
||||
rotate: false
|
||||
xy: 134, 293
|
||||
size: 33, 70
|
||||
orig: 33, 70
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-shoulder
|
||||
rotate: false
|
||||
xy: 137, 43
|
||||
size: 29, 44
|
||||
orig: 29, 44
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-upper-leg
|
||||
rotate: false
|
||||
xy: 30, 65
|
||||
size: 33, 73
|
||||
orig: 33, 73
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/neck
|
||||
rotate: false
|
||||
xy: 201, 387
|
||||
size: 36, 41
|
||||
orig: 36, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/pelvis
|
||||
rotate: false
|
||||
xy: 26, 140
|
||||
size: 62, 43
|
||||
orig: 62, 43
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-arm
|
||||
rotate: false
|
||||
xy: 171, 84
|
||||
size: 23, 50
|
||||
orig: 23, 50
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-foot
|
||||
rotate: false
|
||||
xy: 134, 225
|
||||
size: 63, 33
|
||||
orig: 63, 33
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-hand
|
||||
rotate: false
|
||||
xy: 204, 258
|
||||
size: 36, 37
|
||||
orig: 36, 37
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-lower-leg
|
||||
rotate: false
|
||||
xy: 201, 430
|
||||
size: 36, 76
|
||||
orig: 36, 76
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-shoulder
|
||||
rotate: false
|
||||
xy: 130, 89
|
||||
size: 39, 45
|
||||
orig: 39, 45
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-upper-leg
|
||||
rotate: false
|
||||
xy: 98, 214
|
||||
size: 34, 63
|
||||
orig: 34, 63
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/torso
|
||||
rotate: false
|
||||
xy: 131, 410
|
||||
size: 68, 96
|
||||
orig: 68, 96
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/undie-straps
|
||||
rotate: false
|
||||
xy: 2, 7
|
||||
size: 55, 19
|
||||
orig: 55, 19
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/undies
|
||||
rotate: false
|
||||
xy: 199, 227
|
||||
size: 36, 29
|
||||
orig: 36, 29
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/eyes-closed
|
||||
rotate: false
|
||||
xy: 59, 2
|
||||
size: 37, 21
|
||||
orig: 37, 21
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/head
|
||||
rotate: false
|
||||
xy: 26, 425
|
||||
size: 103, 81
|
||||
orig: 103, 81
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-arm
|
||||
rotate: false
|
||||
xy: 201, 190
|
||||
size: 37, 35
|
||||
orig: 37, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-foot
|
||||
rotate: false
|
||||
xy: 92, 223
|
||||
xy: 134, 192
|
||||
size: 65, 31
|
||||
orig: 65, 31
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-foot
|
||||
rotate: false
|
||||
xy: 92, 188
|
||||
size: 63, 33
|
||||
orig: 63, 33
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/undie-straps
|
||||
rotate: false
|
||||
xy: 92, 167
|
||||
size: 55, 19
|
||||
orig: 55, 19
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-arm
|
||||
rotate: false
|
||||
xy: 159, 219
|
||||
size: 37, 35
|
||||
orig: 37, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-shoulder
|
||||
rotate: false
|
||||
xy: 97, 120
|
||||
size: 39, 45
|
||||
orig: 39, 45
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-shoulder
|
||||
rotate: false
|
||||
xy: 198, 206
|
||||
size: 39, 45
|
||||
orig: 39, 45
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-hand
|
||||
rotate: false
|
||||
xy: 157, 176
|
||||
size: 36, 41
|
||||
orig: 36, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/neck
|
||||
rotate: false
|
||||
xy: 195, 163
|
||||
size: 36, 41
|
||||
orig: 36, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/undie-straps
|
||||
rotate: false
|
||||
xy: 97, 99
|
||||
size: 55, 19
|
||||
orig: 55, 19
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/neck
|
||||
rotate: false
|
||||
xy: 138, 120
|
||||
size: 35, 41
|
||||
orig: 35, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/left-hand
|
||||
rotate: false
|
||||
xy: 175, 121
|
||||
xy: 196, 109
|
||||
size: 35, 40
|
||||
orig: 35, 40
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/left-shoulder
|
||||
goblingirl/left-lower-leg
|
||||
rotate: false
|
||||
xy: 212, 117
|
||||
size: 29, 44
|
||||
orig: 29, 44
|
||||
xy: 169, 293
|
||||
size: 33, 70
|
||||
orig: 33, 70
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/eyes-closed
|
||||
goblingirl/left-shoulder
|
||||
rotate: false
|
||||
xy: 154, 97
|
||||
size: 37, 21
|
||||
orig: 37, 21
|
||||
xy: 107, 30
|
||||
size: 28, 46
|
||||
orig: 28, 46
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblin/right-hand
|
||||
goblingirl/left-upper-leg
|
||||
rotate: false
|
||||
xy: 193, 78
|
||||
size: 36, 37
|
||||
orig: 36, 37
|
||||
xy: 65, 68
|
||||
size: 33, 70
|
||||
orig: 33, 70
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/neck
|
||||
rotate: false
|
||||
xy: 204, 297
|
||||
size: 35, 41
|
||||
orig: 35, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/pelvis
|
||||
rotate: false
|
||||
xy: 131, 365
|
||||
size: 62, 43
|
||||
orig: 62, 43
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-arm
|
||||
rotate: false
|
||||
xy: 100, 97
|
||||
size: 28, 50
|
||||
orig: 28, 50
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-foot
|
||||
rotate: false
|
||||
xy: 134, 157
|
||||
size: 63, 33
|
||||
orig: 63, 33
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-hand
|
||||
rotate: false
|
||||
xy: 74, 39
|
||||
xy: 199, 151
|
||||
size: 36, 37
|
||||
orig: 36, 37
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-lower-leg
|
||||
rotate: false
|
||||
xy: 96, 279
|
||||
size: 36, 76
|
||||
orig: 36, 76
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-shoulder
|
||||
rotate: false
|
||||
xy: 204, 340
|
||||
size: 39, 45
|
||||
orig: 39, 45
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/right-upper-leg
|
||||
rotate: false
|
||||
xy: 98, 149
|
||||
size: 34, 63
|
||||
orig: 34, 63
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/torso
|
||||
rotate: false
|
||||
xy: 26, 259
|
||||
size: 68, 96
|
||||
orig: 68, 96
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/undie-straps
|
||||
rotate: false
|
||||
xy: 134, 136
|
||||
size: 55, 19
|
||||
orig: 55, 19
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goblingirl/undies
|
||||
rotate: false
|
||||
xy: 74, 8
|
||||
xy: 196, 78
|
||||
size: 36, 29
|
||||
orig: 36, 29
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
shield
|
||||
rotate: false
|
||||
xy: 26, 185
|
||||
size: 70, 72
|
||||
orig: 70, 72
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
spear
|
||||
rotate: false
|
||||
xy: 2, 138
|
||||
size: 22, 368
|
||||
orig: 22, 368
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
1076
spine-as3/spine-as3-example/src/goblins-ffd.json
Normal file
1076
spine-as3/spine-as3-example/src/goblins-ffd.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
spine-as3/spine-as3-example/src/goblins-ffd.png
Normal file
BIN
spine-as3/spine-as3-example/src/goblins-ffd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 160 KiB |
@ -1,499 +0,0 @@
|
||||
{
|
||||
"bones": [
|
||||
{ "name": "root" },
|
||||
{ "name": "hip", "parent": "root", "x": 0.64, "y": 114.41 },
|
||||
{ "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 },
|
||||
{ "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 },
|
||||
{ "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 },
|
||||
{ "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 },
|
||||
{ "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 },
|
||||
{ "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 },
|
||||
{ "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 },
|
||||
{ "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 },
|
||||
{ "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92 },
|
||||
{ "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 },
|
||||
{ "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 },
|
||||
{ "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 },
|
||||
{ "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 },
|
||||
{ "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 },
|
||||
{ "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 },
|
||||
{ "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 }
|
||||
],
|
||||
"slots": [
|
||||
{ "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" },
|
||||
{ "name": "left arm", "bone": "left arm", "attachment": "left arm" },
|
||||
{ "name": "left hand item", "bone": "left hand", "attachment": "spear" },
|
||||
{ "name": "left hand", "bone": "left hand", "attachment": "left hand" },
|
||||
{ "name": "left foot", "bone": "left foot", "attachment": "left foot" },
|
||||
{ "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" },
|
||||
{ "name": "left upper leg", "bone": "left upper leg", "attachment": "left upper leg" },
|
||||
{ "name": "neck", "bone": "neck", "attachment": "neck" },
|
||||
{ "name": "torso", "bone": "torso", "attachment": "torso" },
|
||||
{ "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" },
|
||||
{ "name": "right foot", "bone": "right foot", "attachment": "right foot" },
|
||||
{ "name": "right lower leg", "bone": "right lower leg", "attachment": "right lower leg" },
|
||||
{ "name": "undie straps", "bone": "pelvis", "attachment": "undie straps" },
|
||||
{ "name": "undies", "bone": "pelvis", "attachment": "undies" },
|
||||
{ "name": "right upper leg", "bone": "right upper leg", "attachment": "right upper leg" },
|
||||
{ "name": "head", "bone": "head", "attachment": "head" },
|
||||
{ "name": "eyes", "bone": "head" },
|
||||
{ "name": "right shoulder", "bone": "right shoulder", "attachment": "right shoulder" },
|
||||
{ "name": "right arm", "bone": "right arm", "attachment": "right arm" },
|
||||
{ "name": "right hand item", "bone": "right hand", "attachment": "dagger" },
|
||||
{ "name": "right hand", "bone": "right hand", "attachment": "right hand" }
|
||||
],
|
||||
"skins": {
|
||||
"default": {
|
||||
"left hand item": {
|
||||
"dagger": { "x": 7.88, "y": -23.45, "rotation": 10.47, "width": 26, "height": 108 },
|
||||
"spear": { "x": -4.55, "y": 39.2, "rotation": 13.04, "width": 22, "height": 368 }
|
||||
},
|
||||
"right hand item": {
|
||||
"dagger": { "x": 6.51, "y": -24.15, "rotation": -8.06, "width": 26, "height": 108 }
|
||||
}
|
||||
},
|
||||
"goblin": {
|
||||
"neck": {
|
||||
"neck": { "name": "goblin/neck", "x": 10.1, "y": 0.42, "rotation": -93.69, "width": 36, "height": 41 }
|
||||
},
|
||||
"undies": {
|
||||
"undies": { "name": "goblin/undies", "x": 6.3, "y": 0.12, "rotation": 0.91, "width": 36, "height": 29 }
|
||||
},
|
||||
"right hand": {
|
||||
"right hand": { "name": "goblin/right-hand", "x": 7.88, "y": 2.78, "rotation": 91.96, "width": 36, "height": 37 }
|
||||
},
|
||||
"right arm": {
|
||||
"right arm": { "name": "goblin/right-arm", "x": 16.44, "y": -1.04, "rotation": 94.32, "width": 23, "height": 50 }
|
||||
},
|
||||
"head": {
|
||||
"head": { "name": "goblin/head", "x": 25.73, "y": 2.33, "rotation": -92.29, "width": 103, "height": 66 }
|
||||
},
|
||||
"left shoulder": {
|
||||
"left shoulder": { "name": "goblin/left-shoulder", "x": 15.56, "y": -2.26, "rotation": 62.01, "width": 29, "height": 44 }
|
||||
},
|
||||
"left arm": {
|
||||
"left arm": {
|
||||
"name": "goblin/left-arm",
|
||||
"x": 16.7,
|
||||
"y": -1.69,
|
||||
"scaleX": 1.057,
|
||||
"scaleY": 1.057,
|
||||
"rotation": 33.84,
|
||||
"width": 37,
|
||||
"height": 35
|
||||
}
|
||||
},
|
||||
"left hand": {
|
||||
"left hand": {
|
||||
"name": "goblin/left-hand",
|
||||
"x": 3.47,
|
||||
"y": 3.41,
|
||||
"scaleX": 0.892,
|
||||
"scaleY": 0.892,
|
||||
"rotation": 31.14,
|
||||
"width": 36,
|
||||
"height": 41
|
||||
}
|
||||
},
|
||||
"right lower leg": {
|
||||
"right lower leg": { "name": "goblin/right-lower-leg", "x": 25.68, "y": -3.15, "rotation": 111.83, "width": 36, "height": 76 }
|
||||
},
|
||||
"right upper leg": {
|
||||
"right upper leg": { "name": "goblin/right-upper-leg", "x": 20.35, "y": 1.47, "rotation": 97.49, "width": 34, "height": 63 }
|
||||
},
|
||||
"pelvis": {
|
||||
"pelvis": { "name": "goblin/pelvis", "x": -5.61, "y": 0.76, "width": 62, "height": 43 }
|
||||
},
|
||||
"left lower leg": {
|
||||
"left lower leg": { "name": "goblin/left-lower-leg", "x": 23.58, "y": -2.06, "rotation": 105.75, "width": 33, "height": 70 }
|
||||
},
|
||||
"left upper leg": {
|
||||
"left upper leg": { "name": "goblin/left-upper-leg", "x": 29.68, "y": -3.87, "rotation": 89.09, "width": 33, "height": 73 }
|
||||
},
|
||||
"torso": {
|
||||
"torso": { "name": "goblin/torso", "x": 38.09, "y": -3.87, "rotation": -94.95, "width": 68, "height": 96 }
|
||||
},
|
||||
"right shoulder": {
|
||||
"right shoulder": { "name": "goblin/right-shoulder", "x": 15.68, "y": -1.03, "rotation": 130.65, "width": 39, "height": 45 }
|
||||
},
|
||||
"right foot": {
|
||||
"right foot": { "name": "goblin/right-foot", "x": 23.56, "y": 9.8, "rotation": 1.52, "width": 63, "height": 33 }
|
||||
},
|
||||
"left foot": {
|
||||
"left foot": { "name": "goblin/left-foot", "x": 24.85, "y": 8.74, "rotation": 3.32, "width": 65, "height": 31 }
|
||||
},
|
||||
"undie straps": {
|
||||
"undie straps": { "name": "goblin/undie-straps", "x": -3.87, "y": 13.1, "scaleX": 1.089, "width": 55, "height": 19 }
|
||||
},
|
||||
"eyes": {
|
||||
"eyes closed": { "name": "goblin/eyes-closed", "x": 32.21, "y": -21.27, "rotation": -88.92, "width": 34, "height": 12 }
|
||||
}
|
||||
},
|
||||
"goblingirl": {
|
||||
"left upper leg": {
|
||||
"left upper leg": { "name": "goblingirl/left-upper-leg", "x": 30.21, "y": -2.95, "rotation": 89.09, "width": 33, "height": 70 }
|
||||
},
|
||||
"left lower leg": {
|
||||
"left lower leg": { "name": "goblingirl/left-lower-leg", "x": 25.02, "y": -0.6, "rotation": 105.75, "width": 33, "height": 70 }
|
||||
},
|
||||
"left foot": {
|
||||
"left foot": { "name": "goblingirl/left-foot", "x": 25.17, "y": 7.92, "rotation": 3.32, "width": 65, "height": 31 }
|
||||
},
|
||||
"right upper leg": {
|
||||
"right upper leg": { "name": "goblingirl/right-upper-leg", "x": 19.69, "y": 2.13, "rotation": 97.49, "width": 34, "height": 63 }
|
||||
},
|
||||
"right lower leg": {
|
||||
"right lower leg": { "name": "goblingirl/right-lower-leg", "x": 26.15, "y": -3.27, "rotation": 111.83, "width": 36, "height": 76 }
|
||||
},
|
||||
"right foot": {
|
||||
"right foot": { "name": "goblingirl/right-foot", "x": 23.46, "y": 9.66, "rotation": 1.52, "width": 63, "height": 33 }
|
||||
},
|
||||
"torso": {
|
||||
"torso": { "name": "goblingirl/torso", "x": 36.28, "y": -5.14, "rotation": -95.74, "width": 68, "height": 96 }
|
||||
},
|
||||
"left shoulder": {
|
||||
"left shoulder": { "name": "goblingirl/left-shoulder", "x": 19.8, "y": -0.42, "rotation": 61.21, "width": 28, "height": 46 }
|
||||
},
|
||||
"left arm": {
|
||||
"left arm": { "name": "goblingirl/left-arm", "x": 19.64, "y": -2.42, "rotation": 33.05, "width": 37, "height": 35 }
|
||||
},
|
||||
"left hand": {
|
||||
"left hand": {
|
||||
"name": "goblingirl/left-hand",
|
||||
"x": 4.34,
|
||||
"y": 2.39,
|
||||
"scaleX": 0.896,
|
||||
"scaleY": 0.896,
|
||||
"rotation": 30.34,
|
||||
"width": 35,
|
||||
"height": 40
|
||||
}
|
||||
},
|
||||
"neck": {
|
||||
"neck": { "name": "goblingirl/neck", "x": 6.16, "y": -3.14, "rotation": -98.86, "width": 35, "height": 41 }
|
||||
},
|
||||
"head": {
|
||||
"head": { "name": "goblingirl/head", "x": 27.71, "y": -4.32, "rotation": -85.58, "width": 103, "height": 81 }
|
||||
},
|
||||
"right shoulder": {
|
||||
"right shoulder": { "name": "goblingirl/right-shoulder", "x": 14.46, "y": 0.45, "rotation": 129.85, "width": 39, "height": 45 }
|
||||
},
|
||||
"right arm": {
|
||||
"right arm": { "name": "goblingirl/right-arm", "x": 16.85, "y": -0.66, "rotation": 93.52, "width": 28, "height": 50 }
|
||||
},
|
||||
"right hand": {
|
||||
"right hand": { "name": "goblingirl/right-hand", "x": 7.21, "y": 3.43, "rotation": 91.16, "width": 36, "height": 37 }
|
||||
},
|
||||
"pelvis": {
|
||||
"pelvis": { "name": "goblingirl/pelvis", "x": -3.87, "y": 3.18, "width": 62, "height": 43 }
|
||||
},
|
||||
"undie straps": {
|
||||
"undie straps": { "name": "goblingirl/undie-straps", "x": -1.51, "y": 14.18, "width": 55, "height": 19 }
|
||||
},
|
||||
"undies": {
|
||||
"undies": { "name": "goblingirl/undies", "x": 5.4, "y": 1.7, "width": 36, "height": 29 }
|
||||
},
|
||||
"eyes": {
|
||||
"eyes closed": { "name": "goblingirl/eyes-closed", "x": 28, "y": -25.54, "rotation": -87.04, "width": 37, "height": 21 }
|
||||
}
|
||||
}
|
||||
},
|
||||
"animations": {
|
||||
"walk": {
|
||||
"bones": {
|
||||
"left upper leg": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": -26.55 },
|
||||
{ "time": 0.1333, "angle": -8.78 },
|
||||
{ "time": 0.2333, "angle": 9.51 },
|
||||
{ "time": 0.3666, "angle": 30.74 },
|
||||
{ "time": 0.5, "angle": 25.33 },
|
||||
{ "time": 0.6333, "angle": 26.11 },
|
||||
{ "time": 0.7333, "angle": -7.7 },
|
||||
{ "time": 0.8666, "angle": -21.19 },
|
||||
{ "time": 1, "angle": -26.55 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": -1.32, "y": 1.7 },
|
||||
{ "time": 0.3666, "x": -0.06, "y": 2.42 },
|
||||
{ "time": 1, "x": -1.32, "y": 1.7 }
|
||||
]
|
||||
},
|
||||
"right upper leg": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 42.45 },
|
||||
{ "time": 0.1333, "angle": 52.1 },
|
||||
{ "time": 0.2333, "angle": 8.53 },
|
||||
{ "time": 0.5, "angle": -16.93 },
|
||||
{ "time": 0.6333, "angle": 1.89 },
|
||||
{
|
||||
"time": 0.7333,
|
||||
"angle": 28.06,
|
||||
"curve": [ 0.462, 0.11, 1, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.8666,
|
||||
"angle": 58.68,
|
||||
"curve": [ 0.5, 0.02, 1, 1 ]
|
||||
},
|
||||
{ "time": 1, "angle": 42.45 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 6.23, "y": 0 },
|
||||
{ "time": 0.2333, "x": 2.14, "y": 2.4 },
|
||||
{ "time": 0.5, "x": 2.44, "y": 4.8 },
|
||||
{ "time": 1, "x": 6.23, "y": 0 }
|
||||
]
|
||||
},
|
||||
"left lower leg": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": -22.98 },
|
||||
{ "time": 0.1333, "angle": -63.5 },
|
||||
{ "time": 0.2333, "angle": -73.76 },
|
||||
{ "time": 0.5, "angle": 5.11 },
|
||||
{ "time": 0.6333, "angle": -28.29 },
|
||||
{ "time": 0.7333, "angle": 4.08 },
|
||||
{ "time": 0.8666, "angle": 3.53 },
|
||||
{ "time": 1, "angle": -22.98 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": 0 },
|
||||
{ "time": 0.2333, "x": 2.55, "y": -0.47 },
|
||||
{ "time": 0.5, "x": 0, "y": 0, "curve": "stepped" },
|
||||
{ "time": 1, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"left foot": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": -3.69 },
|
||||
{ "time": 0.1333, "angle": -10.42 },
|
||||
{ "time": 0.2333, "angle": -5.01 },
|
||||
{ "time": 0.3666, "angle": 3.87 },
|
||||
{ "time": 0.5, "angle": -3.87 },
|
||||
{ "time": 0.6333, "angle": 2.78 },
|
||||
{ "time": 0.7333, "angle": 1.68 },
|
||||
{ "time": 0.8666, "angle": -8.54 },
|
||||
{ "time": 1, "angle": -3.69 }
|
||||
]
|
||||
},
|
||||
"right shoulder": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": 5.29,
|
||||
"curve": [ 0.264, 0, 0.75, 1 ]
|
||||
},
|
||||
{ "time": 0.6333, "angle": 6.65 },
|
||||
{ "time": 1, "angle": 5.29 }
|
||||
]
|
||||
},
|
||||
"right arm": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": -4.02,
|
||||
"curve": [ 0.267, 0, 0.804, 0.99 ]
|
||||
},
|
||||
{
|
||||
"time": 0.6333,
|
||||
"angle": 19.78,
|
||||
"curve": [ 0.307, 0, 0.787, 0.99 ]
|
||||
},
|
||||
{ "time": 1, "angle": -4.02 }
|
||||
]
|
||||
},
|
||||
"right hand": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 8.98 },
|
||||
{ "time": 0.6333, "angle": 0.51 },
|
||||
{ "time": 1, "angle": 8.98 }
|
||||
]
|
||||
},
|
||||
"left shoulder": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": 6.25,
|
||||
"curve": [ 0.339, 0, 0.683, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.5,
|
||||
"angle": -11.78,
|
||||
"curve": [ 0.281, 0, 0.686, 0.99 ]
|
||||
},
|
||||
{ "time": 1, "angle": 6.25 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 1.15, "y": 0.23 }
|
||||
]
|
||||
},
|
||||
"left hand": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": -21.23,
|
||||
"curve": [ 0.295, 0, 0.755, 0.98 ]
|
||||
},
|
||||
{
|
||||
"time": 0.5,
|
||||
"angle": -27.28,
|
||||
"curve": [ 0.241, 0, 0.75, 0.97 ]
|
||||
},
|
||||
{ "time": 1, "angle": -21.23 }
|
||||
]
|
||||
},
|
||||
"left arm": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": 28.37,
|
||||
"curve": [ 0.339, 0, 0.683, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.5,
|
||||
"angle": 60.09,
|
||||
"curve": [ 0.281, 0, 0.686, 0.99 ]
|
||||
},
|
||||
{ "time": 1, "angle": 28.37 }
|
||||
]
|
||||
},
|
||||
"torso": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": -10.28 },
|
||||
{
|
||||
"time": 0.1333,
|
||||
"angle": -15.38,
|
||||
"curve": [ 0.545, 0, 0.818, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.3666,
|
||||
"angle": -9.78,
|
||||
"curve": [ 0.58, 0.17, 0.669, 0.99 ]
|
||||
},
|
||||
{
|
||||
"time": 0.6333,
|
||||
"angle": -15.75,
|
||||
"curve": [ 0.235, 0.01, 0.795, 1 ]
|
||||
},
|
||||
{
|
||||
"time": 0.8666,
|
||||
"angle": -7.06,
|
||||
"curve": [ 0.209, 0, 0.816, 0.98 ]
|
||||
},
|
||||
{ "time": 1, "angle": -10.28 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": -1.29, "y": 1.68 }
|
||||
]
|
||||
},
|
||||
"right foot": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": -5.25 },
|
||||
{ "time": 0.2333, "angle": -1.91 },
|
||||
{ "time": 0.3666, "angle": -6.45 },
|
||||
{ "time": 0.5, "angle": -5.39 },
|
||||
{ "time": 0.7333, "angle": -11.68 },
|
||||
{ "time": 0.8666, "angle": 0.46 },
|
||||
{ "time": 1, "angle": -5.25 }
|
||||
]
|
||||
},
|
||||
"right lower leg": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": -3.39,
|
||||
"curve": [ 0.316, 0.01, 0.741, 0.98 ]
|
||||
},
|
||||
{
|
||||
"time": 0.1333,
|
||||
"angle": -45.53,
|
||||
"curve": [ 0.229, 0, 0.738, 0.97 ]
|
||||
},
|
||||
{ "time": 0.2333, "angle": -4.83 },
|
||||
{ "time": 0.5, "angle": -19.53 },
|
||||
{ "time": 0.6333, "angle": -64.8 },
|
||||
{
|
||||
"time": 0.7333,
|
||||
"angle": -82.56,
|
||||
"curve": [ 0.557, 0.18, 1, 1 ]
|
||||
},
|
||||
{ "time": 1, "angle": -3.39 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": 0, "curve": "stepped" },
|
||||
{ "time": 0.5, "x": 0, "y": 0 },
|
||||
{ "time": 0.6333, "x": 2.18, "y": 0.21 },
|
||||
{ "time": 1, "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"hip": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 0, "curve": "stepped" },
|
||||
{ "time": 1, "angle": 0 }
|
||||
],
|
||||
"translate": [
|
||||
{ "time": 0, "x": 0, "y": -4.16 },
|
||||
{
|
||||
"time": 0.1333,
|
||||
"x": 0,
|
||||
"y": -7.05,
|
||||
"curve": [ 0.359, 0.47, 0.646, 0.74 ]
|
||||
},
|
||||
{ "time": 0.3666, "x": 0, "y": 6.78 },
|
||||
{ "time": 0.5, "x": 0, "y": -6.13 },
|
||||
{
|
||||
"time": 0.6333,
|
||||
"x": 0,
|
||||
"y": -7.05,
|
||||
"curve": [ 0.359, 0.47, 0.646, 0.74 ]
|
||||
},
|
||||
{ "time": 0.8666, "x": 0, "y": 6.78 },
|
||||
{ "time": 1, "x": 0, "y": -4.16 }
|
||||
]
|
||||
},
|
||||
"neck": {
|
||||
"rotate": [
|
||||
{ "time": 0, "angle": 3.6 },
|
||||
{ "time": 0.1333, "angle": 17.49 },
|
||||
{ "time": 0.2333, "angle": 6.1 },
|
||||
{ "time": 0.3666, "angle": 3.45 },
|
||||
{ "time": 0.5, "angle": 5.17 },
|
||||
{ "time": 0.6333, "angle": 18.36 },
|
||||
{ "time": 0.7333, "angle": 6.09 },
|
||||
{ "time": 0.8666, "angle": 2.28 },
|
||||
{ "time": 1, "angle": 3.6 }
|
||||
]
|
||||
},
|
||||
"head": {
|
||||
"rotate": [
|
||||
{
|
||||
"time": 0,
|
||||
"angle": 3.6,
|
||||
"curve": [ 0, 0, 0.704, 1.17 ]
|
||||
},
|
||||
{ "time": 0.1333, "angle": -0.2 },
|
||||
{ "time": 0.2333, "angle": 6.1 },
|
||||
{ "time": 0.3666, "angle": 3.45 },
|
||||
{
|
||||
"time": 0.5,
|
||||
"angle": 5.17,
|
||||
"curve": [ 0, 0, 0.704, 1.61 ]
|
||||
},
|
||||
{ "time": 0.6666, "angle": 1.1 },
|
||||
{ "time": 0.7333, "angle": 6.09 },
|
||||
{ "time": 0.8666, "angle": 2.28 },
|
||||
{ "time": 1, "angle": 3.6 }
|
||||
]
|
||||
}
|
||||
},
|
||||
"slots": {
|
||||
"eyes": {
|
||||
"attachment": [
|
||||
{ "time": 0.7, "name": "eyes closed" },
|
||||
{ "time": 0.8, "name": null }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 145 KiB |
@ -1,131 +1,194 @@
|
||||
|
||||
spineboy.png
|
||||
format: RGBA8888
|
||||
filter: Nearest,Nearest
|
||||
filter: Linear,Linear
|
||||
repeat: none
|
||||
eyes
|
||||
rotate: false
|
||||
xy: 312, 24
|
||||
size: 34, 27
|
||||
orig: 34, 27
|
||||
eye_indifferent
|
||||
rotate: true
|
||||
xy: 389, 5
|
||||
size: 56, 53
|
||||
orig: 56, 53
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
eyes-closed
|
||||
eye_surprised
|
||||
rotate: false
|
||||
xy: 348, 24
|
||||
size: 34, 27
|
||||
orig: 34, 27
|
||||
xy: 580, 34
|
||||
size: 56, 53
|
||||
orig: 56, 53
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_bracer
|
||||
rotate: false
|
||||
xy: 732, 85
|
||||
size: 35, 48
|
||||
orig: 35, 48
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_fist_closed
|
||||
rotate: false
|
||||
xy: 556, 91
|
||||
size: 45, 49
|
||||
orig: 45, 49
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_fist_open
|
||||
rotate: false
|
||||
xy: 668, 32
|
||||
size: 52, 52
|
||||
orig: 52, 52
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_foot
|
||||
rotate: false
|
||||
xy: 924, 201
|
||||
size: 76, 41
|
||||
orig: 76, 41
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_foot_bend1
|
||||
rotate: false
|
||||
xy: 845, 200
|
||||
size: 77, 42
|
||||
orig: 77, 42
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_foot_bend2
|
||||
rotate: false
|
||||
xy: 778, 186
|
||||
size: 65, 56
|
||||
orig: 65, 56
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_shin
|
||||
rotate: true
|
||||
xy: 444, 91
|
||||
size: 49, 110
|
||||
orig: 49, 110
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_thigh
|
||||
rotate: true
|
||||
xy: 603, 89
|
||||
size: 29, 67
|
||||
orig: 29, 67
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
front_upper_arm
|
||||
rotate: true
|
||||
xy: 672, 86
|
||||
size: 32, 58
|
||||
orig: 32, 58
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
goggles
|
||||
rotate: false
|
||||
xy: 444, 142
|
||||
size: 157, 100
|
||||
orig: 157, 100
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
gun
|
||||
rotate: false
|
||||
xy: 603, 120
|
||||
size: 126, 122
|
||||
orig: 126, 122
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
head
|
||||
rotate: false
|
||||
xy: 279, 63
|
||||
size: 163, 179
|
||||
orig: 163, 179
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
mouth_grind
|
||||
rotate: false
|
||||
xy: 845, 163
|
||||
size: 56, 35
|
||||
orig: 56, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
mouth_oooo
|
||||
rotate: false
|
||||
xy: 842, 126
|
||||
size: 56, 35
|
||||
orig: 56, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
mouth_smile
|
||||
rotate: false
|
||||
xy: 769, 97
|
||||
size: 56, 35
|
||||
orig: 56, 35
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
muzzle
|
||||
rotate: false
|
||||
xy: 2, 2
|
||||
size: 121, 132
|
||||
orig: 121, 132
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
left-arm
|
||||
rotate: true
|
||||
xy: 217, 10
|
||||
size: 35, 29
|
||||
orig: 35, 29
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
left-foot
|
||||
rotate: false
|
||||
xy: 386, 55
|
||||
size: 65, 30
|
||||
orig: 65, 30
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
left-hand
|
||||
rotate: false
|
||||
xy: 125, 2
|
||||
size: 35, 38
|
||||
orig: 35, 38
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
left-lower-leg
|
||||
rotate: true
|
||||
xy: 320, 85
|
||||
size: 49, 64
|
||||
orig: 49, 64
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
left-shoulder
|
||||
rotate: true
|
||||
xy: 162, 6
|
||||
size: 34, 53
|
||||
orig: 34, 53
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
left-upper-leg
|
||||
rotate: true
|
||||
xy: 248, 55
|
||||
size: 33, 67
|
||||
orig: 33, 67
|
||||
size: 275, 240
|
||||
orig: 277, 240
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
neck
|
||||
rotate: false
|
||||
xy: 903, 173
|
||||
size: 22, 25
|
||||
orig: 22, 25
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
rear_bracer
|
||||
rotate: false
|
||||
xy: 722, 40
|
||||
size: 34, 43
|
||||
orig: 34, 43
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
rear_foot
|
||||
rotate: false
|
||||
xy: 444, 11
|
||||
size: 68, 36
|
||||
orig: 68, 36
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
rear_foot_bend1
|
||||
rotate: false
|
||||
xy: 444, 49
|
||||
size: 70, 40
|
||||
orig: 70, 40
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
rear_foot_bend2
|
||||
rotate: false
|
||||
xy: 778, 134
|
||||
size: 62, 50
|
||||
orig: 62, 50
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
rear_shin
|
||||
rotate: false
|
||||
xy: 731, 135
|
||||
size: 45, 107
|
||||
orig: 45, 107
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
rear_thigh
|
||||
rotate: true
|
||||
xy: 282, 19
|
||||
size: 34, 28
|
||||
orig: 34, 28
|
||||
xy: 516, 50
|
||||
size: 39, 62
|
||||
orig: 39, 62
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
pelvis
|
||||
rear_upper_arm
|
||||
rotate: false
|
||||
xy: 386, 87
|
||||
size: 63, 47
|
||||
orig: 63, 47
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
right-arm
|
||||
rotate: true
|
||||
xy: 195, 47
|
||||
size: 21, 45
|
||||
orig: 21, 45
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
right-foot
|
||||
rotate: false
|
||||
xy: 317, 53
|
||||
size: 67, 30
|
||||
orig: 67, 30
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
right-hand
|
||||
rotate: false
|
||||
xy: 248, 21
|
||||
size: 32, 32
|
||||
orig: 32, 32
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
right-lower-leg
|
||||
rotate: false
|
||||
xy: 195, 70
|
||||
size: 51, 64
|
||||
orig: 51, 64
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
right-shoulder
|
||||
rotate: false
|
||||
xy: 386, 2
|
||||
size: 52, 51
|
||||
orig: 52, 51
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
right-upper-leg
|
||||
rotate: true
|
||||
xy: 248, 90
|
||||
size: 44, 70
|
||||
orig: 44, 70
|
||||
xy: 638, 35
|
||||
size: 28, 52
|
||||
orig: 28, 52
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
torso
|
||||
rotate: false
|
||||
xy: 125, 42
|
||||
size: 68, 92
|
||||
orig: 68, 92
|
||||
rotate: true
|
||||
xy: 279, 2
|
||||
size: 59, 108
|
||||
orig: 59, 108
|
||||
offset: 0, 0
|
||||
index: -1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 239 KiB |
@ -86,8 +86,11 @@ public class Skeleton {
|
||||
}
|
||||
|
||||
public function setSlotsToSetupPose () : void {
|
||||
for each (var slot:Slot in _slots)
|
||||
var i:int = 0;
|
||||
for each (var slot:Slot in _slots) {
|
||||
drawOrder[i++] = slot;
|
||||
slot.setToSetupPose();
|
||||
}
|
||||
}
|
||||
|
||||
public function get data () : SkeletonData {
|
||||
@ -170,10 +173,21 @@ public class Skeleton {
|
||||
}
|
||||
|
||||
/** Sets the skin used to look up attachments not found in the {@link SkeletonData#getDefaultSkin() default skin}. Attachments
|
||||
* from the new skin are attached if the corresponding attachment from the old skin was attached.
|
||||
* from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no old skin,
|
||||
* each slot's setup mode attachment is attached from the new skin.
|
||||
* @param newSkin May be null. */
|
||||
public function set skin (newSkin:Skin) : void {
|
||||
if (skin != null && newSkin != null)
|
||||
if (!skin) {
|
||||
var i:int = 0;
|
||||
for each (var slot:Slot in _slots) {
|
||||
var name:String = slot.data.attachmentName;
|
||||
if (name) {
|
||||
var attachment:Attachment = newSkin.getAttachment(i, name);
|
||||
if (attachment) slot.attachment = attachment;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} else if (newSkin)
|
||||
newSkin.attachAll(this, skin);
|
||||
_skin = newSkin;
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ import spine.animation.ColorTimeline;
|
||||
import spine.animation.CurveTimeline;
|
||||
import spine.animation.DrawOrderTimeline;
|
||||
import spine.animation.EventTimeline;
|
||||
import spine.animation.FfdTimeline;
|
||||
import spine.animation.RotateTimeline;
|
||||
import spine.animation.ScaleTimeline;
|
||||
import spine.animation.Timeline;
|
||||
@ -45,7 +46,9 @@ import spine.attachments.Attachment;
|
||||
import spine.attachments.AttachmentLoader;
|
||||
import spine.attachments.AttachmentType;
|
||||
import spine.attachments.BoundingBoxAttachment;
|
||||
import spine.attachments.MeshAttachment;
|
||||
import spine.attachments.RegionAttachment;
|
||||
import spine.attachments.SkinnedMeshAttachment;
|
||||
|
||||
public class SkeletonJson {
|
||||
static public const TIMELINE_SCALE:String = "scale";
|
||||
@ -94,10 +97,10 @@ public class SkeletonJson {
|
||||
boneData.x = (boneMap["x"] || 0) * scale;
|
||||
boneData.y = (boneMap["y"] || 0) * scale;
|
||||
boneData.rotation = (boneMap["rotation"] || 0);
|
||||
boneData.scaleX = boneMap["scaleX"] || 1;
|
||||
boneData.scaleY = boneMap["scaleY"] || 1;
|
||||
boneData.inheritScale = boneMap["inheritScale"] || true;
|
||||
boneData.inheritRotation = boneMap["inheritRotation"] || true;
|
||||
boneData.scaleX = boneMap.hasOwnProperty("scaleX") ? boneMap["scaleX"] : 1;
|
||||
boneData.scaleY = boneMap.hasOwnProperty("scaleY") ? boneMap["scaleY"] : 1;
|
||||
boneData.inheritScale = !boneMap["inheritScale"] || boneMap["inheritScale"] == "true";
|
||||
boneData.inheritRotation = !boneMap["inheritRotation"] || boneMap["inheritRotation"] == "true";
|
||||
skeletonData.addBone(boneData);
|
||||
}
|
||||
|
||||
@ -167,41 +170,155 @@ public class SkeletonJson {
|
||||
name = map["name"] || name;
|
||||
|
||||
var type:AttachmentType = AttachmentType[map["type"] || "region"];
|
||||
var attachment:Attachment = attachmentLoader.newAttachment(skin, type, name);
|
||||
var path:String = map["path"] || name;
|
||||
|
||||
if (attachment is RegionAttachment) {
|
||||
var regionAttachment:RegionAttachment = attachment as RegionAttachment;
|
||||
var scale:Number = this.scale;
|
||||
var color:String, vertices:Vector.<Number>;
|
||||
switch (type) {
|
||||
case AttachmentType.region:
|
||||
var regionAttachment:RegionAttachment = attachmentLoader.newRegionAttachment(skin, name, path);
|
||||
if (!regionAttachment) return null;
|
||||
regionAttachment.path = path;
|
||||
regionAttachment.x = (map["x"] || 0) * scale;
|
||||
regionAttachment.y = (map["y"] || 0) * scale;
|
||||
regionAttachment.scaleX = map["scaleX"] || 1;
|
||||
regionAttachment.scaleY = map["scaleY"] || 1;
|
||||
regionAttachment.scaleX = map.hasOwnProperty("scaleX") ? map["scaleX"] : 1;
|
||||
regionAttachment.scaleY = map.hasOwnProperty("scaleY") ? map["scaleY"] : 1;
|
||||
regionAttachment.rotation = map["rotation"] || 0;
|
||||
regionAttachment.width = (map["width"] || 32) * scale;
|
||||
regionAttachment.height = (map["height"] || 32) * scale;
|
||||
|
||||
var color:String = map["color"];
|
||||
regionAttachment.width = (map["width"] || 0) * scale;
|
||||
regionAttachment.height = (map["height"] || 0) * scale;
|
||||
|
||||
color = map["color"];
|
||||
if (color) {
|
||||
regionAttachment.r = toColor(color, 0);
|
||||
regionAttachment.g = toColor(color, 1);
|
||||
regionAttachment.b = toColor(color, 2);
|
||||
regionAttachment.a = toColor(color, 3);
|
||||
}
|
||||
|
||||
|
||||
regionAttachment.updateOffset();
|
||||
} else if (attachment is BoundingBoxAttachment) {
|
||||
var box:BoundingBoxAttachment = attachment as BoundingBoxAttachment;
|
||||
var vertices:Vector.<Number> = box.vertices;
|
||||
return regionAttachment;
|
||||
|
||||
case AttachmentType.mesh:
|
||||
var mesh:MeshAttachment = attachmentLoader.newMeshAttachment(skin, name, path);
|
||||
if (!mesh) return null;
|
||||
mesh.path = path;
|
||||
mesh.vertices = getFloatArray(map, "vertices", scale);
|
||||
mesh.triangles = getIntArray(map, "triangles");
|
||||
mesh.regionUVs = getFloatArray(map, "uvs", 1);
|
||||
mesh.UpdateUVs();
|
||||
|
||||
color = map["color"];
|
||||
if (color) {
|
||||
mesh.r = toColor(color, 0);
|
||||
mesh.g = toColor(color, 1);
|
||||
mesh.b = toColor(color, 2);
|
||||
mesh.a = toColor(color, 3);
|
||||
}
|
||||
|
||||
mesh.hullLength = (map["hull"] || 0) * 2;
|
||||
if (map["edges"]) mesh.Edges = getIntArray(map, "edges");
|
||||
mesh.width = (map["width"] || 0) * scale;
|
||||
mesh.height = (map["height"] || 0) * scale;
|
||||
return mesh;
|
||||
case AttachmentType.skinnedmesh:
|
||||
var skinnedMesh:SkinnedMeshAttachment = attachmentLoader.newSkinnedMeshAttachment(skin, name, path);
|
||||
if (!skinnedMesh) return null;
|
||||
|
||||
skinnedMesh.Path = path;
|
||||
var uvs:Vector.<Number> = getFloatArray(map, "uvs", 1);
|
||||
vertices = getFloatArray(map, "vertices", 1);
|
||||
var weights:Vector.<Number> = new Vector.<Number>();
|
||||
var bones:Vector.<int> = new Vector.<int>();
|
||||
for (var i:int = 0, n:int = vertices.length; i < n; ) {
|
||||
var boneCount:int = int(vertices[i++]);
|
||||
bones[bones.length] = boneCount;
|
||||
for (var nn:int = i + boneCount * 4; i < nn; ) {
|
||||
bones[bones.length] = vertices[i];
|
||||
weights[weights.length] = vertices[i + 1] * scale;
|
||||
weights[weights.length] = vertices[i + 2] * scale;
|
||||
weights[weights.length] = vertices[i + 3];
|
||||
i += 4;
|
||||
}
|
||||
}
|
||||
skinnedMesh.bones = bones;
|
||||
skinnedMesh.weights = weights;
|
||||
skinnedMesh.triangles = getIntArray(map, "triangles");
|
||||
skinnedMesh.regionUVs = uvs;
|
||||
skinnedMesh.updateUVs();
|
||||
|
||||
color = map["color"];
|
||||
if (color) {
|
||||
skinnedMesh.r = toColor(color, 0);
|
||||
skinnedMesh.g = toColor(color, 1);
|
||||
skinnedMesh.b = toColor(color, 2);
|
||||
skinnedMesh.a = toColor(color, 3);
|
||||
}
|
||||
|
||||
skinnedMesh.hullLength = (map["hull"] || 0) * 2;
|
||||
if (map["edges"]) skinnedMesh.Edges = getIntArray(map, "edges");
|
||||
skinnedMesh.width = (map["width"] || 0) * scale;
|
||||
skinnedMesh.height = (map["height"] || 0) * scale;
|
||||
return skinnedMesh;
|
||||
case AttachmentType.boundingbox:
|
||||
var box:BoundingBoxAttachment = attachmentLoader.newBoundingBoxAttachment(skin, name);
|
||||
vertices = box.vertices;
|
||||
for each (var point:Number in map["vertices"])
|
||||
vertices[vertices.length] = point * scale;
|
||||
return box;
|
||||
}
|
||||
|
||||
return attachment;
|
||||
return null;
|
||||
}
|
||||
|
||||
private function readAnimation (name:String, map:Object, skeletonData:SkeletonData) : void {
|
||||
var timelines:Vector.<Timeline> = new Vector.<Timeline>();
|
||||
var duration:Number = 0;
|
||||
|
||||
var slotMap:Object, slotIndex:int, slotName:String;
|
||||
var values:Array, valueMap:Object, frameIndex:int;
|
||||
var i:int;
|
||||
var timelineName:String;
|
||||
|
||||
var slots:Object = map["slots"];
|
||||
for (slotName in slots) {
|
||||
slotMap = slots[slotName];
|
||||
slotIndex = skeletonData.findSlotIndex(slotName);
|
||||
|
||||
for (timelineName in slotMap) {
|
||||
values = slotMap[timelineName];
|
||||
if (timelineName == TIMELINE_COLOR) {
|
||||
var colorTimeline:ColorTimeline = new ColorTimeline(values.length);
|
||||
colorTimeline.slotIndex = slotIndex;
|
||||
|
||||
frameIndex = 0;
|
||||
for each (valueMap in values) {
|
||||
var color:String = valueMap["color"];
|
||||
var r:Number = toColor(color, 0);
|
||||
var g:Number = toColor(color, 1);
|
||||
var b:Number = toColor(color, 2);
|
||||
var a:Number = toColor(color, 3);
|
||||
colorTimeline.setFrame(frameIndex, valueMap["time"], r, g, b, a);
|
||||
readCurve(colorTimeline, frameIndex, valueMap);
|
||||
frameIndex++;
|
||||
}
|
||||
timelines[timelines.length] = colorTimeline;
|
||||
duration = Math.max(duration, colorTimeline.frames[colorTimeline.frameCount * 5 - 5]);
|
||||
|
||||
} else if (timelineName == TIMELINE_ATTACHMENT) {
|
||||
var attachmentTimeline:AttachmentTimeline = new AttachmentTimeline(values.length);
|
||||
attachmentTimeline.slotIndex = slotIndex;
|
||||
|
||||
frameIndex = 0;
|
||||
for each (valueMap in values)
|
||||
attachmentTimeline.setFrame(frameIndex++, valueMap["time"], valueMap["name"]);
|
||||
timelines[timelines.length] = attachmentTimeline;
|
||||
duration = Math.max(duration, attachmentTimeline.frames[attachmentTimeline.frameCount - 1]);
|
||||
|
||||
} else
|
||||
throw new Error("Invalid timeline type for a slot: " + timelineName + " (" + slotName + ")");
|
||||
}
|
||||
}
|
||||
|
||||
var bones:Object = map["bones"];
|
||||
for (var boneName:String in bones) {
|
||||
var boneIndex:int = skeletonData.findBoneIndex(boneName);
|
||||
@ -209,125 +326,125 @@ public class SkeletonJson {
|
||||
throw new Error("Bone not found: " + boneName);
|
||||
var boneMap:Object = bones[boneName];
|
||||
|
||||
for (var timelineName:Object in boneMap) {
|
||||
var values:Array = boneMap[timelineName];
|
||||
for (timelineName in boneMap) {
|
||||
values = boneMap[timelineName];
|
||||
if (timelineName == TIMELINE_ROTATE) {
|
||||
var timeline:RotateTimeline = new RotateTimeline(values.length);
|
||||
var rotateTimeline:RotateTimeline = new RotateTimeline(values.length);
|
||||
rotateTimeline.boneIndex = boneIndex;
|
||||
|
||||
frameIndex = 0;
|
||||
for each (valueMap in values) {
|
||||
rotateTimeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]);
|
||||
readCurve(rotateTimeline, frameIndex, valueMap);
|
||||
frameIndex++;
|
||||
}
|
||||
timelines[timelines.length] = rotateTimeline;
|
||||
duration = Math.max(duration, rotateTimeline.frames[rotateTimeline.frameCount * 2 - 2]);
|
||||
|
||||
} else if (timelineName == TIMELINE_TRANSLATE || timelineName == TIMELINE_SCALE) {
|
||||
var timeline:TranslateTimeline;
|
||||
var timelineScale:Number = 1;
|
||||
if (timelineName == TIMELINE_SCALE)
|
||||
timeline = new ScaleTimeline(values.length);
|
||||
else {
|
||||
timeline = new TranslateTimeline(values.length);
|
||||
timelineScale = scale;
|
||||
}
|
||||
timeline.boneIndex = boneIndex;
|
||||
|
||||
var frameIndex:int = 0;
|
||||
for each (var valueMap:Object in values) {
|
||||
timeline.setFrame(frameIndex, valueMap["time"], valueMap["angle"]);
|
||||
frameIndex = 0;
|
||||
for each (valueMap in values) {
|
||||
var x:Number = (valueMap["x"] || 0) * timelineScale;
|
||||
var y:Number = (valueMap["y"] || 0) * timelineScale;
|
||||
timeline.setFrame(frameIndex, valueMap["time"], x, y);
|
||||
readCurve(timeline, frameIndex, valueMap);
|
||||
frameIndex++;
|
||||
}
|
||||
timelines[timelines.length] = timeline;
|
||||
duration = Math.max(duration, timeline.frames[timeline.frameCount * 2 - 2]);
|
||||
|
||||
} else if (timelineName == TIMELINE_TRANSLATE || timelineName == TIMELINE_SCALE) {
|
||||
var timeline1:TranslateTimeline;
|
||||
var timelineScale:Number = 1;
|
||||
if (timelineName == TIMELINE_SCALE)
|
||||
timeline1 = new ScaleTimeline(values.length);
|
||||
else {
|
||||
timeline1 = new TranslateTimeline(values.length);
|
||||
timelineScale = scale;
|
||||
}
|
||||
timeline1.boneIndex = boneIndex;
|
||||
|
||||
var frameIndex1:int = 0;
|
||||
for each (var valueMap1:Object in values) {
|
||||
var x:Number = (valueMap1["x"] || 0) * timelineScale;
|
||||
var y:Number = (valueMap1["y"] || 0) * timelineScale;
|
||||
timeline1.setFrame(frameIndex1, valueMap1["time"], x, y);
|
||||
readCurve(timeline1, frameIndex1, valueMap1);
|
||||
frameIndex1++;
|
||||
}
|
||||
timelines[timelines.length] = timeline1;
|
||||
duration = Math.max(duration, timeline1.frames[timeline1.frameCount * 3 - 3]);
|
||||
duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]);
|
||||
|
||||
} else
|
||||
throw new Error("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
|
||||
}
|
||||
}
|
||||
|
||||
var slots:Object = map["slots"];
|
||||
for (var slotName:String in slots) {
|
||||
var slotMap:Object = slots[slotName];
|
||||
var slotIndex:int = skeletonData.findSlotIndex(slotName);
|
||||
var ffd:Object = map["ffd"];
|
||||
for (var skinName:String in ffd) {
|
||||
var skin:Skin = skeletonData.findSkin(skinName);
|
||||
slotMap = ffd[skinName];
|
||||
for (slotName in slotMap) {
|
||||
slotIndex = skeletonData.findSlotIndex(slotName);
|
||||
var meshMap:Object = slotMap[slotName];
|
||||
for (var meshName:String in meshMap) {
|
||||
values = meshMap[meshName];
|
||||
var ffdTimeline:FfdTimeline = new FfdTimeline(values.length);
|
||||
var attachment:Attachment = skin.getAttachment(slotIndex, meshName);
|
||||
if (!attachment) throw new Error("FFD attachment not found: " + meshName);
|
||||
ffdTimeline.slotIndex = slotIndex;
|
||||
ffdTimeline.attachment = attachment;
|
||||
|
||||
var vertexCount:int ;
|
||||
if (attachment is MeshAttachment)
|
||||
vertexCount = (attachment as MeshAttachment).vertices.length;
|
||||
else
|
||||
vertexCount = (attachment as SkinnedMeshAttachment).weights.length / 3 * 2;
|
||||
|
||||
for (var timelineName2:Object in slotMap) {
|
||||
var values2:Object = slotMap[timelineName2];
|
||||
if (timelineName2 == TIMELINE_COLOR) {
|
||||
var timeline2:ColorTimeline = new ColorTimeline(values2.length);
|
||||
timeline2.slotIndex = slotIndex;
|
||||
|
||||
var frameIndex2:int = 0;
|
||||
for each (var valueMap2:Object in values2) {
|
||||
var color:String = valueMap2["color"];
|
||||
var r:Number = toColor(color, 0);
|
||||
var g:Number = toColor(color, 1);
|
||||
var b:Number = toColor(color, 2);
|
||||
var a:Number = toColor(color, 3);
|
||||
timeline2.setFrame(frameIndex2, valueMap2["time"], r, g, b, a);
|
||||
readCurve(timeline2, frameIndex2, valueMap2);
|
||||
frameIndex2++;
|
||||
frameIndex = 0;
|
||||
for each (valueMap in values) {
|
||||
var vertices:Vector.<Number>;
|
||||
if (!valueMap["vertices"]) {
|
||||
if (attachment is MeshAttachment)
|
||||
vertices = (attachment as MeshAttachment).vertices;
|
||||
else
|
||||
vertices = new Vector.<Number>(vertexCount, true);
|
||||
} else {
|
||||
var verticesValue:Array = valueMap["vertices"];
|
||||
vertices = new Vector.<Number>(vertexCount, true);
|
||||
var start:int = valueMap["offset"] || 0;
|
||||
var n:int = verticesValue.length;
|
||||
if (scale == 1) {
|
||||
for (i = 0; i < n; i++)
|
||||
vertices[i + start] = verticesValue[i];
|
||||
} else {
|
||||
for (i = 0; i < n; i++)
|
||||
vertices[i + start] = verticesValue[i] * scale;
|
||||
}
|
||||
if (attachment is MeshAttachment) {
|
||||
var meshVertices:Vector.<Number> = (attachment as MeshAttachment).vertices;
|
||||
for (i = 0, n = vertices.length; i < n; i++)
|
||||
vertices[i] += meshVertices[i];
|
||||
}
|
||||
}
|
||||
|
||||
ffdTimeline.setFrame(frameIndex, valueMap["time"], vertices);
|
||||
readCurve(ffdTimeline, frameIndex, valueMap);
|
||||
frameIndex++;
|
||||
}
|
||||
timelines[timelines.length] = timeline2;
|
||||
duration = Math.max(duration, timeline2.frames[timeline2.frameCount * 5 - 5]);
|
||||
|
||||
} else if (timelineName2 == TIMELINE_ATTACHMENT) {
|
||||
var timeline3:AttachmentTimeline = new AttachmentTimeline(values2.length);
|
||||
timeline3.slotIndex = slotIndex;
|
||||
|
||||
var frameIndex3:int = 0;
|
||||
for each (var valueMap3:Object in values2) {
|
||||
timeline3.setFrame(frameIndex3++, valueMap3["time"], valueMap3["name"]);
|
||||
}
|
||||
timelines[timelines.length] = timeline3;
|
||||
duration = Math.max(duration, timeline3.frames[timeline3.frameCount - 1]);
|
||||
|
||||
} else
|
||||
throw new Error("Invalid timeline type for a slot: " + timelineName2 + " (" + slotName + ")");
|
||||
timelines[timelines.length] = ffdTimeline;
|
||||
duration = Math.max(duration, ffdTimeline.frames[ffdTimeline.frameCount - 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var eventsMap:Object = map["events"];
|
||||
if (eventsMap) {
|
||||
var timeline4:EventTimeline = new EventTimeline(eventsMap.length);
|
||||
var frameIndex4:int = 0;
|
||||
for each (var eventMap:Object in eventsMap) {
|
||||
var eventData:EventData = skeletonData.findEvent(eventMap["name"]);
|
||||
if (eventData == null) throw new Error("Event not found: " + eventMap["name"]);
|
||||
var event:Event = new Event(eventData);
|
||||
event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue;
|
||||
event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue;
|
||||
event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue;
|
||||
timeline4.setFrame(frameIndex4++, eventMap["time"], event);
|
||||
}
|
||||
timelines[timelines.length] = timeline4;
|
||||
duration = Math.max(duration, timeline4.frames[timeline4.frameCount - 1]);
|
||||
}
|
||||
|
||||
var drawOrderValues:Object = map["draworder"];
|
||||
if (drawOrderValues) {
|
||||
var timeline5:DrawOrderTimeline = new DrawOrderTimeline(drawOrderValues.length);
|
||||
var drawOrderTimeline:DrawOrderTimeline = new DrawOrderTimeline(drawOrderValues.length);
|
||||
var slotCount:int = skeletonData.slots.length;
|
||||
var frameIndex5:int = 0;
|
||||
frameIndex = 0;
|
||||
for each (var drawOrderMap:Object in drawOrderValues) {
|
||||
var drawOrder:Vector.<int> = null;
|
||||
if (drawOrderMap["offsets"]) {
|
||||
drawOrder = new Vector.<int>(slotCount);
|
||||
for (var i:int = slotCount - 1; i >= 0; i--)
|
||||
for (i = slotCount - 1; i >= 0; i--)
|
||||
drawOrder[i] = -1;
|
||||
var offsets:Object = drawOrderMap["offsets"];
|
||||
var unchanged:Vector.<int> = new Vector.<int>(slotCount - offsets.length);
|
||||
var originalIndex:int = 0, unchangedIndex:int = 0;
|
||||
for each (var offsetMap:Object in offsets) {
|
||||
var slotIndex2:int = skeletonData.findSlotIndex(offsetMap["slot"]);
|
||||
if (slotIndex2 == -1) throw new Error("Slot not found: " + offsetMap["slot"]);
|
||||
slotIndex = skeletonData.findSlotIndex(offsetMap["slot"]);
|
||||
if (slotIndex == -1) throw new Error("Slot not found: " + offsetMap["slot"]);
|
||||
// Collect unchanged items.
|
||||
while (originalIndex != slotIndex2)
|
||||
while (originalIndex != slotIndex)
|
||||
unchanged[unchangedIndex++] = originalIndex++;
|
||||
// Set changed items.
|
||||
drawOrder[originalIndex + offsetMap["offset"]] = originalIndex++;
|
||||
@ -339,16 +456,33 @@ public class SkeletonJson {
|
||||
for (i = slotCount - 1; i >= 0; i--)
|
||||
if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex];
|
||||
}
|
||||
timeline5.setFrame(frameIndex5++, drawOrderMap["time"], drawOrder);
|
||||
drawOrderTimeline.setFrame(frameIndex++, drawOrderMap["time"], drawOrder);
|
||||
}
|
||||
timelines[timelines.length] = timeline5;
|
||||
duration = Math.max(duration, timeline5.frames[timeline5.frameCount - 1]);
|
||||
timelines[timelines.length] = drawOrderTimeline;
|
||||
duration = Math.max(duration, drawOrderTimeline.frames[drawOrderTimeline.frameCount - 1]);
|
||||
}
|
||||
|
||||
var eventsMap:Object = map["events"];
|
||||
if (eventsMap) {
|
||||
var eventTimeline:EventTimeline = new EventTimeline(eventsMap.length);
|
||||
frameIndex = 0;
|
||||
for each (var eventMap:Object in eventsMap) {
|
||||
var eventData:EventData = skeletonData.findEvent(eventMap["name"]);
|
||||
if (eventData == null) throw new Error("Event not found: " + eventMap["name"]);
|
||||
var event:Event = new Event(eventData);
|
||||
event.intValue = eventMap.hasOwnProperty("int") ? eventMap["int"] : eventData.intValue;
|
||||
event.floatValue = eventMap.hasOwnProperty("float") ? eventMap["float"] : eventData.floatValue;
|
||||
event.stringValue = eventMap.hasOwnProperty("string") ? eventMap["string"] : eventData.stringValue;
|
||||
eventTimeline.setFrame(frameIndex++, eventMap["time"], event);
|
||||
}
|
||||
timelines[timelines.length] = eventTimeline;
|
||||
duration = Math.max(duration, eventTimeline.frames[eventTimeline.frameCount - 1]);
|
||||
}
|
||||
|
||||
skeletonData.addAnimation(new Animation(name, timelines, duration));
|
||||
}
|
||||
|
||||
private function readCurve (timeline:CurveTimeline, frameIndex:int, valueMap:Object) : void {
|
||||
static private function readCurve (timeline:CurveTimeline, frameIndex:int, valueMap:Object) : void {
|
||||
var curve:Object = valueMap["curve"];
|
||||
if (curve == null)
|
||||
return;
|
||||
@ -364,6 +498,28 @@ public class SkeletonJson {
|
||||
throw new ArgumentError("Color hexidecimal length must be 8, recieved: " + hexString);
|
||||
return parseInt(hexString.substring(colorIndex * 2, colorIndex * 2 + 2), 16) / 255;
|
||||
}
|
||||
|
||||
static private function getFloatArray (map:Object, name:String, scale:Number) : Vector.<Number> {
|
||||
var list:Array = map[name];
|
||||
var values:Vector.<Number> = new Vector.<Number>(list.Count, true);
|
||||
var i:int = 0, n:int = list.length;
|
||||
if (scale == 1) {
|
||||
for (; i < n; i++)
|
||||
values[i] = list[i];
|
||||
} else {
|
||||
for (; i < n; i++)
|
||||
values[i] = list[i] * scale;
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
static private function getIntArray (map:Object, name:String) : Vector.<int> {
|
||||
var list:Array = map[name];
|
||||
var values:Vector.<int> = new Vector.<int>(list.Count, true);
|
||||
for (var i:int = 0, n:int = list.length; i < n; i++)
|
||||
values[i] = int(list[i]);
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ public class Slot {
|
||||
public var a:Number;
|
||||
internal var _attachment:Attachment;
|
||||
private var _attachmentTime:Number;
|
||||
public var attachmentVertices:Vector.<Number> = new Vector.<Number>();
|
||||
|
||||
public function Slot (data:SlotData, skeleton:Skeleton, bone:Bone) {
|
||||
if (data == null)
|
||||
@ -77,6 +78,7 @@ public class Slot {
|
||||
public function set attachment (attachment:Attachment) : void {
|
||||
_attachment = attachment;
|
||||
_attachmentTime = _skeleton.time;
|
||||
attachmentVertices.length = 0;
|
||||
}
|
||||
|
||||
public function set attachmentTime (time:Number) : void {
|
||||
|
||||
@ -54,11 +54,11 @@ public class AnimationState {
|
||||
var current:TrackEntry = _tracks[i];
|
||||
if (!current) continue;
|
||||
|
||||
var trackDelta:Number = delta * current.timeScale;
|
||||
current.time += trackDelta;
|
||||
current.time += delta * current.timeScale;
|
||||
if (current.previous) {
|
||||
current.previous.time += trackDelta;
|
||||
current.mixTime += trackDelta;
|
||||
var previousDelta:Number = delta * current.previous.timeScale;
|
||||
current.previous.time += previousDelta;
|
||||
current.mixTime += previousDelta;
|
||||
}
|
||||
|
||||
var next:TrackEntry = current.next;
|
||||
|
||||
@ -34,12 +34,12 @@ import spine.Skeleton;
|
||||
|
||||
public class AttachmentTimeline implements Timeline {
|
||||
public var slotIndex:int;
|
||||
public var frames:Vector.<Number> = new Vector.<Number>(); // time, ...
|
||||
public var attachmentNames:Vector.<String> = new Vector.<String>();
|
||||
public var frames:Vector.<Number>; // time, ...
|
||||
public var attachmentNames:Vector.<String>;
|
||||
|
||||
public function AttachmentTimeline (frameCount:int) {
|
||||
frames.length = frameCount;
|
||||
attachmentNames.length = frameCount;
|
||||
frames = new Vector.<Number>(frameCount, true);
|
||||
attachmentNames = new Vector.<String>(frameCount, true);
|
||||
}
|
||||
|
||||
public function get frameCount () : int {
|
||||
|
||||
@ -41,11 +41,11 @@ public class ColorTimeline extends CurveTimeline {
|
||||
static private const FRAME_A:int = 4;
|
||||
|
||||
public var slotIndex:int;
|
||||
public var frames:Vector.<Number> = new Vector.<Number>(); // time, r, g, b, a, ...
|
||||
public var frames:Vector.<Number>; // time, r, g, b, a, ...
|
||||
|
||||
public function ColorTimeline (frameCount:int) {
|
||||
super(frameCount);
|
||||
frames.length = frameCount * 5;
|
||||
frames = new Vector.<Number>(frameCount * 5, true);
|
||||
}
|
||||
|
||||
/** Sets the time and value of the specified keyframe. */
|
||||
@ -62,31 +62,31 @@ public class ColorTimeline extends CurveTimeline {
|
||||
if (time < frames[0])
|
||||
return; // Time is before first frame.
|
||||
|
||||
var slot:Slot = skeleton.slots[slotIndex];
|
||||
|
||||
if (time >= frames[int(frames.length - 5)]) { // Time is after last frame.
|
||||
var r:Number, g:Number, b:Number, a:Number;
|
||||
if (time >= frames[int(frames.length - 5)]) {
|
||||
// Time is after last frame.
|
||||
var i:int = frames.length - 1;
|
||||
slot.r = frames[int(i - 3)];
|
||||
slot.g = frames[int(i - 2)];
|
||||
slot.b = frames[int(i - 1)];
|
||||
slot.a = frames[i];
|
||||
return;
|
||||
r = frames[int(i - 3)];
|
||||
g = frames[int(i - 2)];
|
||||
b = frames[int(i - 1)];
|
||||
a = frames[i];
|
||||
} else {
|
||||
// Interpolate between the previous frame and the current frame.
|
||||
var frameIndex:int = Animation.binarySearch(frames, time, 5);
|
||||
var prevFrameR:Number = frames[int(frameIndex - 4)];
|
||||
var prevFrameG:Number = frames[int(frameIndex - 3)];
|
||||
var prevFrameB:Number = frames[int(frameIndex - 2)];
|
||||
var prevFrameA:Number = frames[int(frameIndex - 1)];
|
||||
var frameTime:Number = frames[frameIndex];
|
||||
var percent:Number = 1 - (time - frameTime) / (frames[int(frameIndex + PREV_FRAME_TIME)] - frameTime);
|
||||
percent = getCurvePercent(frameIndex / 5 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
|
||||
|
||||
r = prevFrameR + (frames[int(frameIndex + FRAME_R)] - prevFrameR) * percent;
|
||||
g = prevFrameG + (frames[int(frameIndex + FRAME_G)] - prevFrameG) * percent;
|
||||
b = prevFrameB + (frames[int(frameIndex + FRAME_B)] - prevFrameB) * percent;
|
||||
a = prevFrameA + (frames[int(frameIndex + FRAME_A)] - prevFrameA) * percent;
|
||||
}
|
||||
|
||||
// Interpolate between the previous frame and the current frame.
|
||||
var frameIndex:int = Animation.binarySearch(frames, time, 5);
|
||||
var prevFrameR:Number = frames[int(frameIndex - 4)];
|
||||
var prevFrameG:Number = frames[int(frameIndex - 3)];
|
||||
var prevFrameB:Number = frames[int(frameIndex - 2)];
|
||||
var prevFrameA:Number = frames[int(frameIndex - 1)];
|
||||
var frameTime:Number = frames[frameIndex];
|
||||
var percent:Number = 1 - (time - frameTime) / (frames[int(frameIndex + PREV_FRAME_TIME)] - frameTime);
|
||||
percent = getCurvePercent(frameIndex / 5 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
|
||||
|
||||
var r:Number = prevFrameR + (frames[int(frameIndex + FRAME_R)] - prevFrameR) * percent;
|
||||
var g:Number = prevFrameG + (frames[int(frameIndex + FRAME_G)] - prevFrameG) * percent;
|
||||
var b:Number = prevFrameB + (frames[int(frameIndex + FRAME_B)] - prevFrameB) * percent;
|
||||
var a:Number = prevFrameA + (frames[int(frameIndex + FRAME_A)] - prevFrameA) * percent;
|
||||
var slot:Slot = skeleton.slots[slotIndex];
|
||||
if (alpha < 1) {
|
||||
slot.r += (r - slot.r) * alpha;
|
||||
slot.g += (g - slot.g) * alpha;
|
||||
|
||||
@ -38,10 +38,10 @@ public class CurveTimeline implements Timeline {
|
||||
static private const STEPPED:Number = -1;
|
||||
static private const BEZIER_SEGMENTS:int = 10;
|
||||
|
||||
private var curves:Vector.<Number> = new Vector.<Number>(); // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
|
||||
private var curves:Vector.<Number>; // dfx, dfy, ddfx, ddfy, dddfx, dddfy, ...
|
||||
|
||||
public function CurveTimeline (frameCount:int) {
|
||||
curves.length = frameCount * 6;
|
||||
curves = new Vector.<Number>(frameCount * 6, true)
|
||||
}
|
||||
|
||||
public function apply (skeleton:Skeleton, lastTime:Number, time:Number, firedEvents:Vector.<Event>, alpha:Number) : void {
|
||||
|
||||
@ -34,12 +34,12 @@ import spine.Skeleton;
|
||||
import spine.Slot;
|
||||
|
||||
public class DrawOrderTimeline implements Timeline {
|
||||
public var frames:Vector.<Number> = new Vector.<Number>(); // time, ...
|
||||
public var drawOrders:Vector.<Vector.<int>> = new Vector.<Vector.<int>>();
|
||||
public var frames:Vector.<Number>; // time, ...
|
||||
public var drawOrders:Vector.<Vector.<int>>;
|
||||
|
||||
public function DrawOrderTimeline (frameCount:int) {
|
||||
frames.length = frameCount;
|
||||
drawOrders.length = frameCount;
|
||||
frames = new Vector.<Number>(frameCount, true);
|
||||
drawOrders = new Vector.<Vector.<int>>(frameCount, true);
|
||||
}
|
||||
|
||||
public function get frameCount () : int {
|
||||
|
||||
@ -34,12 +34,12 @@ import spine.Skeleton;
|
||||
import spine.Slot;
|
||||
|
||||
public class EventTimeline implements Timeline {
|
||||
public var frames:Vector.<Number> = new Vector.<Number>(); // time, ...
|
||||
public var events:Vector.<Event> = new Vector.<Event>();
|
||||
public var frames:Vector.<Number>; // time, ...
|
||||
public var events:Vector.<Event>;
|
||||
|
||||
public function EventTimeline (frameCount:int) {
|
||||
frames.length = frameCount;
|
||||
events.length = frameCount;
|
||||
frames = new Vector.<Number>(frameCount, true);
|
||||
events = new Vector.<Event>(frameCount, true)
|
||||
}
|
||||
|
||||
public function get frameCount () : int {
|
||||
|
||||
112
spine-as3/spine-as3/src/spine/animation/FfdTimeline.as
Normal file
112
spine-as3/spine-as3/src/spine/animation/FfdTimeline.as
Normal file
@ -0,0 +1,112 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
package spine.animation {
|
||||
import spine.Event;
|
||||
import spine.Skeleton;
|
||||
import spine.Slot;
|
||||
import spine.attachments.Attachment;
|
||||
|
||||
public class FfdTimeline extends CurveTimeline {
|
||||
public var slotIndex:int;
|
||||
public var frames:Vector.<Number>;
|
||||
public var frameVertices:Vector.<Vector.<Number>>;
|
||||
public var attachment:Attachment;
|
||||
|
||||
public function FfdTimeline (frameCount:int) {
|
||||
super(frameCount);
|
||||
frames = new Vector.<Number>(frameCount, true);
|
||||
frameVertices = new Vector.<Number>(frameCount, true);
|
||||
}
|
||||
|
||||
/** Sets the time and value of the specified keyframe. */
|
||||
public function setFrame (frameIndex:int, time:Number, vertices:Vector.<Number>) : void {
|
||||
frames[frameIndex] = time;
|
||||
frameVertices[frameIndex] = vertices;
|
||||
}
|
||||
|
||||
override public function apply (skeleton:Skeleton, lastTime:Number, time:Number, firedEvents:Vector.<Event>, alpha:Number) : void {
|
||||
var slot:Slot = skeleton.slots[slotIndex];
|
||||
if (slot.attachment != attachment) return;
|
||||
|
||||
var frames:Vector.<Number> = this.frames;
|
||||
if (time < frames[0]) {
|
||||
slot.attachmentVertices.length = 0;
|
||||
return; // Time is before first frame.
|
||||
}
|
||||
|
||||
var frameVertices:Vector.<Vector.<Number>> = this.frameVertices;
|
||||
var vertexCount:int = frameVertices[0].length;
|
||||
|
||||
var vertices:Vector.<Number> = slot.attachmentVertices;
|
||||
if (vertices.length < vertexCount) {
|
||||
vertices = new Vector.<Number>(vertexCount);
|
||||
slot.attachmentVertices = vertices;
|
||||
}
|
||||
slot.attachmentVertices.length = vertexCount;
|
||||
|
||||
var i:int;
|
||||
if (time >= frames[frames.length - 1]) { // Time is after last frame.
|
||||
var lastVertices:Vector.<Number> = frameVertices[frames.length - 1];
|
||||
if (alpha < 1) {
|
||||
for (i = 0; i < vertexCount; i++)
|
||||
vertices[i] += (lastVertices[i] - vertices[i]) * alpha;
|
||||
} else {
|
||||
for (i = 0; i < vertexCount; i++)
|
||||
vertices[i] = lastVertices[i];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Interpolate between the previous frame and the current frame.
|
||||
var frameIndex:int = Animation.binarySearch(frames, time, 1);
|
||||
var frameTime:Number = frames[frameIndex];
|
||||
var percent:Number = 1 - (time - frameTime) / (frames[frameIndex - 1] - frameTime);
|
||||
percent = getCurvePercent(frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));
|
||||
|
||||
var prevVertices:Vector.<Number> = frameVertices[frameIndex - 1];
|
||||
var nextVertices:Vector.<Number> = frameVertices[frameIndex];
|
||||
|
||||
var prev:Number;
|
||||
if (alpha < 1) {
|
||||
for (i = 0; i < vertexCount; i++) {
|
||||
prev = prevVertices[i];
|
||||
vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < vertexCount; i++) {
|
||||
prev = prevVertices[i];
|
||||
vertices[i] = prev + (nextVertices[i] - prev) * percent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -38,11 +38,11 @@ public class RotateTimeline extends CurveTimeline {
|
||||
static private const FRAME_VALUE:int = 1;
|
||||
|
||||
public var boneIndex:int;
|
||||
public var frames:Vector.<Number> = new Vector.<Number>(); // time, value, ...
|
||||
public var frames:Vector.<Number>; // time, value, ...
|
||||
|
||||
public function RotateTimeline (frameCount:int) {
|
||||
super(frameCount);
|
||||
frames.length = frameCount * 2;
|
||||
frames = new Vector.<Number>(frameCount * 2, true);
|
||||
}
|
||||
|
||||
/** Sets the time and angle of the specified keyframe. */
|
||||
|
||||
@ -39,11 +39,11 @@ public class TranslateTimeline extends CurveTimeline {
|
||||
static internal const FRAME_Y:int = 2;
|
||||
|
||||
public var boneIndex:int;
|
||||
public var frames:Vector.<Number> = new Vector.<Number>(); // time, value, value, ...
|
||||
public var frames:Vector.<Number>; // time, value, value, ...
|
||||
|
||||
public function TranslateTimeline (frameCount:int) {
|
||||
super(frameCount);
|
||||
frames.length = frameCount * 3;
|
||||
frames = new Vector.<Number>(frameCount * 3, true);
|
||||
}
|
||||
|
||||
/** Sets the time and value of the specified keyframe. */
|
||||
|
||||
@ -41,27 +41,65 @@ public class AtlasAttachmentLoader implements AttachmentLoader {
|
||||
throw new ArgumentError("atlas cannot be null.");
|
||||
this.atlas = atlas;
|
||||
}
|
||||
|
||||
public function newRegionAttachment (skin:Skin, name:String, path:String) : RegionAttachment {
|
||||
var region:AtlasRegion = atlas.findRegion(name);
|
||||
if (region == null)
|
||||
throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
|
||||
var attachment:RegionAttachment = new RegionAttachment(name);
|
||||
attachment.rendererObject = region;
|
||||
attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
|
||||
attachment.regionOffsetX = region.offsetX;
|
||||
attachment.regionOffsetY = region.offsetY;
|
||||
attachment.regionWidth = region.width;
|
||||
attachment.regionHeight = region.height;
|
||||
attachment.regionOriginalWidth = region.originalWidth;
|
||||
attachment.regionOriginalHeight = region.originalHeight;
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public function newMeshAttachment (skin:Skin, name:String, path:String) : MeshAttachment {
|
||||
var region:AtlasRegion = atlas.findRegion(name);
|
||||
if (region == null)
|
||||
throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")");
|
||||
var attachment:MeshAttachment = new MeshAttachment(name);
|
||||
attachment.rendererObject = region;
|
||||
attachment.regionU = region.u;
|
||||
attachment.regionV = region.v;
|
||||
attachment.regionU2 = region.u2;
|
||||
attachment.regionV2 = region.v2;
|
||||
attachment.regionRotate = region.rotate;
|
||||
attachment.regionOffsetX = region.offsetX;
|
||||
attachment.regionOffsetY = region.offsetY;
|
||||
attachment.regionWidth = region.width;
|
||||
attachment.regionHeight = region.height;
|
||||
attachment.regionOriginalWidth = region.originalWidth;
|
||||
attachment.regionOriginalHeight = region.originalHeight;
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public function newSkinnedMeshAttachment (skin:Skin, name:String, path:String) : SkinnedMeshAttachment {
|
||||
var region:AtlasRegion = atlas.findRegion(name);
|
||||
if (region == null)
|
||||
throw new Error("Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")");
|
||||
var attachment:SkinnedMeshAttachment = new SkinnedMeshAttachment(name);
|
||||
attachment.rendererObject = region;
|
||||
attachment.regionU = region.u;
|
||||
attachment.regionV = region.v;
|
||||
attachment.regionU2 = region.u2;
|
||||
attachment.regionV2 = region.v2;
|
||||
attachment.regionRotate = region.rotate;
|
||||
attachment.regionOffsetX = region.offsetX;
|
||||
attachment.regionOffsetY = region.offsetY;
|
||||
attachment.regionWidth = region.width;
|
||||
attachment.regionHeight = region.height;
|
||||
attachment.regionOriginalWidth = region.originalWidth;
|
||||
attachment.regionOriginalHeight = region.originalHeight;
|
||||
return attachment;
|
||||
}
|
||||
|
||||
public function newAttachment (skin:Skin, type:AttachmentType, name:String) : Attachment {
|
||||
switch (type) {
|
||||
case AttachmentType.region:
|
||||
var region:AtlasRegion = atlas.findRegion(name);
|
||||
if (region == null)
|
||||
throw new Error("Region not found in atlas: " + name + " (" + type + ")");
|
||||
var attachment:RegionAttachment = new RegionAttachment(name);
|
||||
attachment.rendererObject = region;
|
||||
attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate);
|
||||
attachment.regionOffsetX = region.offsetX;
|
||||
attachment.regionOffsetY = region.offsetY;
|
||||
attachment.regionWidth = region.width;
|
||||
attachment.regionHeight = region.height;
|
||||
attachment.regionOriginalWidth = region.originalWidth;
|
||||
attachment.regionOriginalHeight = region.originalHeight;
|
||||
return attachment;
|
||||
case AttachmentType.boundingbox:
|
||||
return new BoundingBoxAttachment(name);
|
||||
}
|
||||
throw new Error("Unknown attachment type: " + type);
|
||||
public function newBoundingBoxAttachment (skin:Skin, name:String) : BoundingBoxAttachment {
|
||||
return new BoundingBoxAttachment(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,16 @@ import spine.Skin;
|
||||
|
||||
public interface AttachmentLoader {
|
||||
/** @return May be null to not load an attachment. */
|
||||
function newAttachment (skin:Skin, type:AttachmentType, name:String) : Attachment;
|
||||
function newRegionAttachment (skin:Skin, name:String, path:String) : RegionAttachment;
|
||||
|
||||
/** @return May be null to not load an attachment. */
|
||||
function newMeshAttachment (skin:Skin, name:String, path:String) : MeshAttachment;
|
||||
|
||||
/** @return May be null to not load an attachment. */
|
||||
function newSkinnedMeshAttachment (skin:Skin, name:String, path:String) : SkinnedMeshAttachment;
|
||||
|
||||
/** @return May be null to not load an attachment. */
|
||||
function newBoundingBoxAttachment (skin:Skin, name:String) : BoundingBoxAttachment;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -33,7 +33,9 @@ package spine.attachments {
|
||||
public class AttachmentType {
|
||||
public static const region:AttachmentType = new AttachmentType(0, "region");
|
||||
public static const regionsequence:AttachmentType = new AttachmentType(1, "regionsequence");
|
||||
public static const boundingbox:AttachmentType = new AttachmentType(1, "boundingbox");
|
||||
public static const boundingbox:AttachmentType = new AttachmentType(2, "boundingbox");
|
||||
public static const mesh:AttachmentType = new AttachmentType(3, "mesh");
|
||||
public static const skinnedmesh:AttachmentType = new AttachmentType(4, "skinnedmesh");
|
||||
|
||||
public var ordinal:int;
|
||||
public var name:String;
|
||||
|
||||
106
spine-as3/spine-as3/src/spine/attachments/MeshAttachment.as
Normal file
106
spine-as3/spine-as3/src/spine/attachments/MeshAttachment.as
Normal file
@ -0,0 +1,106 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
package spine.attachments {
|
||||
import spine.Slot;
|
||||
import spine.Bone;
|
||||
|
||||
public dynamic class MeshAttachment extends Attachment {
|
||||
public var vertices:Vector.<Number>;
|
||||
public var uvs:Vector.<Number>;
|
||||
public var regionUVs:Vector.<Number>;
|
||||
public var triangles:Vector.<int>;
|
||||
public var hullLength:int;
|
||||
public var r:Number = 1;
|
||||
public var g:Number = 1;
|
||||
public var b:Number = 1;
|
||||
public var a:Number = 1;
|
||||
|
||||
public var path:String;
|
||||
public var rendererObject:Object;
|
||||
public var regionU:Number;
|
||||
public var regionV:Number;
|
||||
public var regionU2:Number;
|
||||
public var regionV2:Number;
|
||||
public var regionRotate:Boolean;
|
||||
public var regionOffsetX:Number; // Pixels stripped from the bottom left, unrotated.
|
||||
public var regionOffsetY:Number;
|
||||
public var regionWidth:Number; // Unrotated, stripped size.
|
||||
public var regionHeight:Number;
|
||||
public var regionOriginalWidth:Number; // Unrotated, unstripped size.
|
||||
public var regionOriginalHeight:Number;
|
||||
|
||||
// Nonessential.
|
||||
public var edges:Vector.<int>;
|
||||
public var width:Number;
|
||||
public var height:Number;
|
||||
|
||||
public function MeshAttachment (name:String) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public function UpdateUVs () : void {
|
||||
var width:Number = regionU2 - regionU, height:Number = regionV2 - regionV;
|
||||
if (!uvs || uvs.length != regionUVs.length) uvs = new Vector.<Number>(regionUVs.length, true);
|
||||
var i:int, n:int = uvs.length;
|
||||
if (regionRotate) {
|
||||
for (i = 0; i < n; i += 2) {
|
||||
uvs[i] = regionU + regionUVs[i + 1] * width;
|
||||
uvs[i + 1] = regionV + height - regionUVs[i] * height;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < n; i += 2) {
|
||||
uvs[i] = regionU + regionUVs[i] * width;
|
||||
uvs[i + 1] = regionV + regionUVs[i + 1] * height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function computeWorldVertices (x:Number, y:Number, slot:Slot, worldVertices:Vector.<Number>) : void {
|
||||
var bone:Bone = slot.bone;
|
||||
x += bone.worldX;
|
||||
y += bone.worldY;
|
||||
var m00:Number = bone.m00;
|
||||
var m01:Number = bone.m01;
|
||||
var m10:Number = bone.m10;
|
||||
var m11:Number = bone.m11;
|
||||
var vertices:Vector.<Number> = this.vertices;
|
||||
var verticesCount:int = vertices.length;
|
||||
if (slot.attachmentVertices.length == verticesCount) vertices = slot.attachmentVertices;
|
||||
for (var i:int = 0; i < verticesCount; i += 2) {
|
||||
var vx:Number = vertices[i];
|
||||
var vy:Number = vertices[i + 1];
|
||||
worldVertices[i] = vx * m00 + vy * m01 + x;
|
||||
worldVertices[i + 1] = vx * m10 + vy * m11 + y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -53,6 +53,7 @@ public dynamic class RegionAttachment extends Attachment {
|
||||
public var b:Number = 1;
|
||||
public var a:Number = 1;
|
||||
|
||||
public var path:String;
|
||||
public var rendererObject:Object;
|
||||
public var regionOffsetX:Number; // Pixels stripped from the bottom left, unrotated.
|
||||
public var regionOffsetY:Number;
|
||||
@ -120,7 +121,7 @@ public dynamic class RegionAttachment extends Attachment {
|
||||
offset[Y4] = localYCos + localX2Sin;
|
||||
}
|
||||
|
||||
public function computeWorldVertices (x:Number, y:Number, bone:Bone, vertices:Vector.<Number>) : void {
|
||||
public function computeWorldVertices (x:Number, y:Number, bone:Bone, worldVertices:Vector.<Number>) : void {
|
||||
x += bone.worldX;
|
||||
y += bone.worldY;
|
||||
var m00:Number = bone.m00;
|
||||
@ -135,14 +136,14 @@ public dynamic class RegionAttachment extends Attachment {
|
||||
var y3:Number = offset[Y3];
|
||||
var x4:Number = offset[X4];
|
||||
var y4:Number = offset[Y4];
|
||||
vertices[X1] = x1 * m00 + y1 * m01 + x;
|
||||
vertices[Y1] = x1 * m10 + y1 * m11 + y;
|
||||
vertices[X2] = x2 * m00 + y2 * m01 + x;
|
||||
vertices[Y2] = x2 * m10 + y2 * m11 + y;
|
||||
vertices[X3] = x3 * m00 + y3 * m01 + x;
|
||||
vertices[Y3] = x3 * m10 + y3 * m11 + y;
|
||||
vertices[X4] = x4 * m00 + y4 * m01 + x;
|
||||
vertices[Y4] = x4 * m10 + y4 * m11 + y;
|
||||
worldVertices[X1] = x1 * m00 + y1 * m01 + x;
|
||||
worldVertices[Y1] = x1 * m10 + y1 * m11 + y;
|
||||
worldVertices[X2] = x2 * m00 + y2 * m01 + x;
|
||||
worldVertices[Y2] = x2 * m10 + y2 * m11 + y;
|
||||
worldVertices[X3] = x3 * m00 + y3 * m01 + x;
|
||||
worldVertices[Y3] = x3 * m10 + y3 * m11 + y;
|
||||
worldVertices[X4] = x4 * m00 + y4 * m01 + x;
|
||||
worldVertices[Y4] = x4 * m10 + y4 * m11 + y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,131 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes Software License
|
||||
* Version 2.1
|
||||
*
|
||||
* Copyright (c) 2013, Esoteric Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* You are granted a perpetual, non-exclusive, non-sublicensable and
|
||||
* non-transferable license to install, execute and perform the Spine Runtimes
|
||||
* Software (the "Software") solely for internal use. Without the written
|
||||
* permission of Esoteric Software (typically granted by licensing Spine), you
|
||||
* may not (a) modify, translate, adapt or otherwise create derivative works,
|
||||
* improvements of the Software or develop new applications using the Software
|
||||
* or (b) remove, delete, alter or obscure any trademarks or any copyright,
|
||||
* trademark, patent or other intellectual property or proprietary rights
|
||||
* notices on or in the Software, including any copy thereof. Redistributions
|
||||
* in binary or source form must include this license and terms.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
package spine.attachments {
|
||||
import spine.Slot;
|
||||
import spine.Bone;
|
||||
|
||||
public dynamic class SkinnedMeshAttachment extends Attachment {
|
||||
public var bones:Vector.<int>;
|
||||
public var weights:Vector.<Number>;
|
||||
public var uvs:Vector.<Number>;
|
||||
public var regionUVs:Vector.<Number>;
|
||||
public var triangles:Vector.<int>;
|
||||
public var hullLength:int;
|
||||
public var r:Number = 1;
|
||||
public var g:Number = 1;
|
||||
public var b:Number = 1;
|
||||
public var a:Number = 1;
|
||||
|
||||
public var path:String;
|
||||
public var rendererObject:Object;
|
||||
public var regionU:Number;
|
||||
public var regionV:Number;
|
||||
public var regionU2:Number;
|
||||
public var regionV2:Number;
|
||||
public var regionRotate:Boolean;
|
||||
public var regionOffsetX:Number; // Pixels stripped from the bottom left, unrotated.
|
||||
public var regionOffsetY:Number;
|
||||
public var regionWidth:Number; // Unrotated, stripped size.
|
||||
public var regionHeight:Number;
|
||||
public var regionOriginalWidth:Number; // Unrotated, unstripped size.
|
||||
public var regionOriginalHeight:Number;
|
||||
|
||||
// Nonessential.
|
||||
public var edges:Vector.<int>;
|
||||
public var width:Number;
|
||||
public var height:Number;
|
||||
|
||||
public function SkinnedMeshAttachment (name:String) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public function UpdateUVs () : void {
|
||||
var width:Number = regionU2 - regionU, height:Number = regionV2 - regionV;
|
||||
if (!uvs || uvs.length != regionUVs.length) uvs = new Vector.<Number>(regionUVs.length, true);
|
||||
var i:int, n:int = uvs.length;
|
||||
if (regionRotate) {
|
||||
for (i = 0; i < n; i += 2) {
|
||||
uvs[i] = regionU + regionUVs[i + 1] * width;
|
||||
uvs[i + 1] = regionV + height - regionUVs[i] * height;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < n; i += 2) {
|
||||
uvs[i] = regionU + regionUVs[i] * width;
|
||||
uvs[i + 1] = regionV + regionUVs[i + 1] * height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function computeWorldVertices (x:Number, y:Number, slot:Slot, worldVertices:Vector.<Number>) : void {
|
||||
var skeletonBones:Vector.<Bone> = slot.skeleton.bones;
|
||||
var weights:Vector.<Number> = this.weights;
|
||||
var bones:Vector.<int> = this.bones;
|
||||
|
||||
var w:int = 0, v:int = 0, b:int = 0, f:int = 0, n:int = bones.length, nn:int;
|
||||
var wx:Number, wy:Number, bone:Bone, vx:Number, vy:Number, weight:Number;
|
||||
if (slot.attachmentVertices.length == 0) {
|
||||
for (; v < n; w += 2) {
|
||||
wx = 0;
|
||||
wy = 0;
|
||||
nn = bones[v++] + v;
|
||||
for (; v < nn; v++, b += 3) {
|
||||
bone = skeletonBones[bones[v]];
|
||||
vx = weights[b];
|
||||
vy = weights[b + 1];
|
||||
weight = weights[b + 2];
|
||||
wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight;
|
||||
wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight;
|
||||
}
|
||||
worldVertices[w] = wx + x;
|
||||
worldVertices[w + 1] = wy + y;
|
||||
}
|
||||
} else {
|
||||
var ffd:Vector.<Number> = slot.attachmentVertices;
|
||||
for (; v < n; w += 2) {
|
||||
wx = 0;
|
||||
wy = 0;
|
||||
nn = bones[v++] + v;
|
||||
for (; v < nn; v++, b += 3, f += 2) {
|
||||
bone = skeletonBones[bones[v]];
|
||||
vx = weights[b] + ffd[f];
|
||||
vy = weights[b + 1] + ffd[f + 1];
|
||||
weight = weights[b + 2];
|
||||
wx += (vx * bone.m00 + vy * bone.m01 + bone.worldX) * weight;
|
||||
wy += (vx * bone.m10 + vy * bone.m11 + bone.worldY) * weight;
|
||||
}
|
||||
worldVertices[w] = wx + x;
|
||||
worldVertices[w + 1] = wy + y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user