Fancier SkeletonTest for trying skeleton files, organized assets.

This commit is contained in:
NathanSweet 2014-02-27 19:41:07 +01:00
parent 7570e0a18c
commit fa52abc780
24 changed files with 1861 additions and 850 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="assets"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/gdx-backend-lwjgl"/>

View File

@ -4,281 +4,288 @@ format: RGBA8888
filter: Linear,Linear
repeat: none
dagger
rotate: true
xy: 372, 100
rotate: false
xy: 2, 28
size: 26, 108
orig: 26, 108
offset: 0, 0
index: -1
goblin/eyes-closed
rotate: false
xy: 380, 8
xy: 137, 29
size: 34, 12
orig: 34, 12
offset: 0, 0
index: -1
goblin/head
rotate: false
xy: 107, 36
xy: 26, 357
size: 103, 66
orig: 103, 66
offset: 0, 0
index: -1
goblin/left-arm
rotate: false
xy: 684, 20
xy: 30, 28
size: 37, 35
orig: 37, 35
offset: 0, 0
index: -1
goblin/left-foot
rotate: false
xy: 773, 95
xy: 134, 260
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
goblin/left-hand
rotate: true
xy: 779, 57
rotate: false
xy: 69, 25
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
goblin/left-lower-leg
rotate: true
xy: 557, 93
rotate: false
xy: 134, 293
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblin/left-shoulder
rotate: false
xy: 456, 2
xy: 137, 43
size: 29, 44
orig: 29, 44
offset: 0, 0
index: -1
goblin/left-upper-leg
rotate: true
xy: 482, 93
rotate: false
xy: 30, 65
size: 33, 73
orig: 33, 73
offset: 0, 0
index: -1
goblin/neck
rotate: true
xy: 822, 57
rotate: false
xy: 201, 387
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
goblin/pelvis
rotate: false
xy: 456, 48
xy: 26, 140
size: 62, 43
orig: 62, 43
offset: 0, 0
index: -1
goblin/right-arm
rotate: true
xy: 972, 73
rotate: false
xy: 171, 84
size: 23, 50
orig: 23, 50
offset: 0, 0
index: -1
goblin/right-foot
rotate: false
xy: 907, 93
xy: 134, 225
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
goblin/right-hand
rotate: true
xy: 723, 20
rotate: false
xy: 204, 258
size: 36, 37
orig: 36, 37
offset: 0, 0
index: -1
goblin/right-lower-leg
rotate: false
xy: 380, 22
xy: 201, 430
size: 36, 76
orig: 36, 76
offset: 0, 0
index: -1
goblin/right-shoulder
rotate: true
xy: 487, 7
rotate: false
xy: 130, 89
size: 39, 45
orig: 39, 45
offset: 0, 0
index: -1
goblin/right-upper-leg
rotate: true
xy: 584, 57
rotate: false
xy: 98, 214
size: 34, 63
orig: 34, 63
offset: 0, 0
index: -1
goblin/torso
rotate: true
xy: 212, 34
rotate: false
xy: 131, 410
size: 68, 96
orig: 68, 96
offset: 0, 0
index: -1
goblin/undie-straps
rotate: false
xy: 107, 15
xy: 2, 7
size: 55, 19
orig: 55, 19
offset: 0, 0
index: -1
goblin/undies
rotate: false
xy: 581, 5
xy: 199, 227
size: 36, 29
orig: 36, 29
offset: 0, 0
index: -1
goblingirl/eyes-closed
rotate: false
xy: 164, 13
xy: 59, 2
size: 37, 21
orig: 37, 21
offset: 0, 0
index: -1
goblingirl/head
rotate: false
xy: 2, 21
xy: 26, 425
size: 103, 81
orig: 103, 81
offset: 0, 0
index: -1
goblingirl/left-arm
rotate: false
xy: 762, 20
xy: 201, 190
size: 37, 35
orig: 37, 35
offset: 0, 0
index: -1
goblingirl/left-foot
rotate: false
xy: 840, 95
xy: 134, 192
size: 65, 31
orig: 65, 31
offset: 0, 0
index: -1
goblingirl/left-hand
rotate: true
xy: 865, 58
rotate: false
xy: 196, 109
size: 35, 40
orig: 35, 40
offset: 0, 0
index: -1
goblingirl/left-lower-leg
rotate: true
xy: 629, 93
rotate: false
xy: 169, 293
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblingirl/left-shoulder
rotate: true
xy: 907, 63
rotate: false
xy: 107, 30
size: 28, 46
orig: 28, 46
offset: 0, 0
index: -1
goblingirl/left-upper-leg
rotate: true
xy: 701, 93
rotate: false
xy: 65, 68
size: 33, 70
orig: 33, 70
offset: 0, 0
index: -1
goblingirl/neck
rotate: true
xy: 641, 20
rotate: false
xy: 204, 297
size: 35, 41
orig: 35, 41
offset: 0, 0
index: -1
goblingirl/pelvis
rotate: false
xy: 520, 48
xy: 131, 365
size: 62, 43
orig: 62, 43
offset: 0, 0
index: -1
goblingirl/right-arm
rotate: true
xy: 972, 98
rotate: false
xy: 100, 97
size: 28, 50
orig: 28, 50
offset: 0, 0
index: -1
goblingirl/right-foot
rotate: false
xy: 714, 58
xy: 134, 157
size: 63, 33
orig: 63, 33
offset: 0, 0
index: -1
goblingirl/right-hand
rotate: true
xy: 801, 19
rotate: false
xy: 199, 151
size: 36, 37
orig: 36, 37
offset: 0, 0
index: -1
goblingirl/right-lower-leg
rotate: false
xy: 418, 22
xy: 96, 279
size: 36, 76
orig: 36, 76
offset: 0, 0
index: -1
goblingirl/right-shoulder
rotate: true
xy: 534, 7
rotate: false
xy: 204, 340
size: 39, 45
orig: 39, 45
offset: 0, 0
index: -1
goblingirl/right-upper-leg
rotate: true
xy: 649, 57
rotate: false
xy: 98, 149
size: 34, 63
orig: 34, 63
offset: 0, 0
index: -1
goblingirl/torso
rotate: false
xy: 310, 2
xy: 26, 259
size: 68, 96
orig: 68, 96
offset: 0, 0
index: -1
goblingirl/undie-straps
rotate: false
xy: 584, 36
xy: 134, 136
size: 55, 19
orig: 55, 19
offset: 0, 0
index: -1
goblingirl/undies
rotate: true
xy: 840, 19
rotate: false
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: true
xy: 2, 104
rotate: false
xy: 2, 138
size: 22, 368
orig: 22, 368
offset: 0, 0

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

View File

@ -0,0 +1,198 @@
skin.png
format: RGBA8888
filter: Nearest,Nearest
repeat: none
default
rotate: false
xy: 1, 50
size: 254, 77
orig: 254, 77
offset: 0, 0
index: -1
default-window
rotate: false
xy: 1, 20
size: 27, 29
split: 4, 3, 20, 3
orig: 27, 29
offset: 0, 0
index: -1
default-select
rotate: false
xy: 29, 29
size: 27, 20
split: 4, 14, 4, 4
orig: 27, 20
offset: 0, 0
index: -1
default-round-large
rotate: false
xy: 57, 29
size: 20, 20
split: 5, 5, 5, 4
orig: 20, 20
offset: 0, 0
index: -1
default-scroll
rotate: false
xy: 78, 29
size: 20, 20
split: 2, 2, 2, 2
orig: 20, 20
offset: 0, 0
index: -1
default-slider-knob
rotate: false
xy: 1, 1
size: 9, 18
orig: 9, 18
offset: 0, 0
index: -1
default-round-down
rotate: false
xy: 99, 29
size: 12, 20
split: 5, 5, 5, 4
orig: 12, 20
offset: 0, 0
index: -1
default-round
rotate: false
xy: 112, 29
size: 12, 20
split: 5, 5, 5, 4
pad: 4, 4, 1, 1
orig: 12, 20
offset: 0, 0
index: -1
check-off
rotate: false
xy: 11, 5
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
textfield
rotate: false
xy: 11, 5
size: 14, 14
split: 3, 3, 3, 3
orig: 14, 14
offset: 0, 0
index: -1
check-on
rotate: false
xy: 125, 35
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
tree-minus
rotate: false
xy: 140, 35
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
tree-plus
rotate: false
xy: 155, 35
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
default-slider
rotate: false
xy: 29, 20
size: 8, 8
split: 2, 2, 2, 2
orig: 8, 8
offset: 0, 0
index: -1
default-pane
rotate: false
xy: 11, 1
size: 5, 3
split: 1, 1, 1, 1
orig: 5, 3
offset: 0, 0
index: -1
default-rect-pad
rotate: false
xy: 11, 1
size: 5, 3
split: 1, 1, 1, 1
orig: 5, 3
offset: 0, 0
index: -1
default-splitpane
rotate: false
xy: 17, 1
size: 5, 3
split: 0, 5, 0, 0
orig: 5, 3
offset: 0, 0
index: -1
cursor
rotate: false
xy: 23, 1
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-splitpane-vertical
rotate: false
xy: 125, 29
size: 3, 5
split: 0, 0, 0, 5
orig: 3, 5
offset: 0, 0
index: -1
default-rect-down
rotate: false
xy: 170, 46
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-rect
rotate: false
xy: 38, 25
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-select-selection
rotate: false
xy: 26, 16
size: 3, 3
split: 1, 1, 1, 1
orig: 3, 3
offset: 0, 0
index: -1
default-pane-noborder
rotate: false
xy: 129, 33
size: 1, 1
split: 0, 0, 0, 0
orig: 1, 1
offset: 0, 0
index: -1
selection
rotate: false
xy: 170, 44
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1
white
rotate: false
xy: 174, 48
size: 1, 1
orig: 1, 1
offset: 0, 0
index: -1

View File

@ -0,0 +1,59 @@
{
com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: com/badlogic/gdx/utils/arial-15.fnt } },
com.badlogic.gdx.graphics.Color: {
green: { a: 1, b: 0, g: 1, r: 0 },
white: { a: 1, b: 1, g: 1, r: 1 },
red: { a: 1, b: 0, g: 0, r: 1 },
black: { a: 1, b: 0, g: 0, r: 0 }
},
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
dialogDim: { name: white, color: { r: 0, g: 0, b: 0, a: 0.45 } }
},
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
default: { down: default-round-down, up: default-round },
toggle: { down: default-round-down, checked: default-round-down, up: default-round }
},
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
default: { down: default-round-down, up: default-round, font: default-font, fontColor: white },
toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontColor: white, downFontColor: red }
},
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large }
},
com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
default: {
font: default-font, fontColor: white, background: default-select,
scrollStyle: default,
listStyle: { font: default-font, selection: default-select-selection }
}
},
com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: {
default-vertical: { handle: default-splitpane-vertical },
default-horizontal: { handle: default-splitpane }
},
com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
default: { titleFont: default-font, background: default-window, titleFontColor: white },
dialog: { titleFont: default-font, background: default-window, titleFontColor: white, stageBackground: dialogDim }
},
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
default-horizontal: { background: default-slider, knob: default-slider-knob }
},
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
default: { font: default-font, fontColor: white }
},
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor }
},
com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: {
default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white }
},
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
default: { fontColorUnselected: white, selection: selection, fontColorSelected: white, font: default-font }
},
com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: {
default: { background: default-pane, knob: default-round-large }
},
com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: {
default: { minus: tree-minus, plus: tree-plus, selection: default-select-selection }
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB

View File

@ -3,164 +3,129 @@ spineboy.png
format: RGBA8888
filter: Linear,Linear
repeat: none
head
eyes
rotate: false
xy: 1, 122
xy: 447, 44
size: 34, 27
orig: 34, 27
offset: 0, 0
index: -1
eyes-closed
rotate: true
xy: 483, 37
size: 34, 27
orig: 34, 27
offset: 0, 0
index: -1
head
rotate: true
xy: 2, 5
size: 121, 132
orig: 121, 132
offset: 0, 0
index: -1
torso
rotate: false
xy: 1, 28
size: 68, 92
orig: 68, 92
offset: 0, 0
index: -1
left-pant-bottom
rotate: false
xy: 1, 4
size: 44, 22
orig: 44, 22
offset: 0, 0
index: -1
right-pant-bottom
rotate: false
xy: 47, 8
size: 46, 18
orig: 46, 18
offset: 0, 0
index: -1
right-upper-leg
rotate: false
xy: 71, 50
size: 44, 70
orig: 44, 70
offset: 0, 0
index: -1
pelvis
rotate: false
xy: 95, 1
size: 63, 47
orig: 63, 47
offset: 0, 0
index: -1
left-upper-leg
rotate: false
xy: 117, 53
size: 33, 67
orig: 33, 67
offset: 0, 0
index: -1
right-foot
rotate: false
xy: 160, 224
size: 67, 30
orig: 67, 30
offset: 0, 0
index: -1
left-shoulder
rotate: false
xy: 124, 201
size: 34, 53
orig: 34, 53
offset: 0, 0
index: -1
left-ankle
rotate: false
xy: 229, 222
size: 25, 32
orig: 25, 32
offset: 0, 0
index: -1
left-foot
rotate: false
xy: 160, 192
size: 65, 30
orig: 65, 30
offset: 0, 0
index: -1
neck
rotate: false
xy: 124, 171
size: 34, 28
orig: 34, 28
offset: 0, 0
index: -1
right-arm
rotate: false
xy: 124, 124
size: 21, 45
orig: 21, 45
offset: 0, 0
index: -1
right-ankle
rotate: false
xy: 227, 190
size: 25, 30
orig: 25, 30
offset: 0, 0
index: -1
left-hand
rotate: false
xy: 147, 131
size: 35, 38
orig: 35, 38
offset: 0, 0
index: -1
left-arm
rotate: false
xy: 184, 161
rotate: true
xy: 382, 40
size: 35, 29
orig: 35, 29
offset: 0, 0
index: -1
eyes-closed
left-foot
rotate: false
xy: 221, 161
size: 34, 27
orig: 34, 27
xy: 205, 2
size: 65, 30
orig: 65, 30
offset: 0, 0
index: -1
right-lower-leg
left-hand
rotate: false
xy: 152, 65
size: 51, 64
orig: 51, 64
offset: 0, 0
index: -1
right-foot-idle
rotate: false
xy: 184, 131
size: 53, 28
orig: 53, 28
xy: 272, 7
size: 35, 38
orig: 35, 38
offset: 0, 0
index: -1
left-lower-leg
rotate: false
xy: 205, 65
rotate: true
xy: 331, 77
size: 49, 64
orig: 49, 64
offset: 0, 0
index: -1
right-shoulder
left-shoulder
rotate: false
xy: 160, 12
size: 52, 51
orig: 52, 51
xy: 462, 73
size: 34, 53
orig: 34, 53
offset: 0, 0
index: -1
eyes
left-upper-leg
rotate: true
xy: 259, 47
size: 33, 67
orig: 33, 67
offset: 0, 0
index: -1
neck
rotate: false
xy: 214, 36
size: 34, 27
orig: 34, 27
xy: 382, 10
size: 34, 28
orig: 34, 28
offset: 0, 0
index: -1
pelvis
rotate: false
xy: 397, 79
size: 63, 47
orig: 63, 47
offset: 0, 0
index: -1
right-arm
rotate: true
xy: 206, 39
size: 21, 45
orig: 21, 45
offset: 0, 0
index: -1
right-foot
rotate: false
xy: 136, 2
size: 67, 30
orig: 67, 30
offset: 0, 0
index: -1
right-hand
rotate: false
xy: 214, 2
xy: 413, 45
size: 32, 32
orig: 32, 32
offset: 0, 0
index: -1
right-lower-leg
rotate: false
xy: 206, 62
size: 51, 64
orig: 51, 64
offset: 0, 0
index: -1
right-shoulder
rotate: false
xy: 328, 24
size: 52, 51
orig: 52, 51
offset: 0, 0
index: -1
right-upper-leg
rotate: true
xy: 259, 82
size: 44, 70
orig: 44, 70
offset: 0, 0
index: -1
torso
rotate: false
xy: 136, 34
size: 68, 92
orig: 68, 92
offset: 0, 0
index: -1

View File

@ -5,7 +5,7 @@
{ "name": "left upper leg", "parent": "hip", "length": 50.39, "x": 14.45, "y": 2.81, "rotation": -89.09 },
{ "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 },
{ "name": "right upper leg", "parent": "hip", "length": 45.76, "x": -18.27, "rotation": -101.13 },
{ "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 94.95 },
{ "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 99.4 },
{ "name": "left lower leg", "parent": "left upper leg", "length": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 },
{ "name": "left shoulder", "parent": "torso", "length": 44.19, "x": 78.96, "y": -15.75, "rotation": -156.96 },
{ "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 },
@ -34,7 +34,7 @@
{ "name": "neck", "bone": "neck", "attachment": "neck" },
{ "name": "head", "bone": "head", "attachment": "head" },
{ "name": "eyes", "bone": "head", "attachment": "eyes" },
{ "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder", "additive": true },
{ "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder" },
{ "name": "right arm", "bone": "right arm", "attachment": "right-arm" },
{ "name": "right hand", "bone": "right hand", "attachment": "right-hand" },
{ "name": "bb-head", "bone": "head", "attachment": "bb-head" }
@ -44,24 +44,7 @@
"bb-head": {
"bb-head": {
"type": "boundingbox",
"vertices": [
55.69696,
-44.60648,
8.2226715,
-47.609646,
-11.244263,
-32.942703,
-0.05206299,
35.835804,
61.018433,
43.227512,
90.35846,
-16.054127,
115.41275,
-32.817406,
78.29431,
-56.05409
]
"vertices": [ 77.2608, -53.82651, 105.80151, -32.42244, 58.433777, 40.348133, 5.8296814, 37.007954, -7.0167694, -42.236595 ]
}
},
"eyes": {
@ -124,20 +107,20 @@
"headPop": {}
},
"animations": {
"drawOrder": {
"headPop": {
"bones": {
"head": {
"rotate": [
{ "time": 0, "angle": 0 },
{ "time": 0.4827, "angle": -23.11 },
{ "time": 0.8965, "angle": -56.45 },
{ "time": 1.3103, "angle": 1.38 },
{ "time": 1.7931, "angle": 36.12 },
{ "time": 2.1379, "angle": 1.24 },
{ "time": 2.6206, "angle": -37.12 },
{ "time": 2.9666, "angle": 2.07 },
{ "time": 3.4666, "angle": 34.72 },
{ "time": 3.9, "angle": 359.99 }
{ "time": 0.9614, "angle": -23.11 },
{ "time": 1.7856, "angle": -56.45 },
{ "time": 2.6097, "angle": 1.38 },
{ "time": 3.5712, "angle": 36.12 },
{ "time": 4.258, "angle": 1.24 },
{ "time": 5.2195, "angle": -37.12 },
{ "time": 5.9086, "angle": 2.07 },
{ "time": 6.9044, "angle": 34.72 },
{ "time": 7.7675, "angle": 359.99 }
],
"translate": [
{
@ -147,167 +130,167 @@
"curve": [ 0.19, 0.4, 0.586, 0.75 ]
},
{
"time": 0.2758,
"time": 0.5494,
"x": 57.88,
"y": -35.72,
"curve": [ 0.39, 0.54, 0.632, 0.72 ]
},
{
"time": 0.4827,
"time": 0.9614,
"x": 87.26,
"y": -87.89,
"curve": [ 0.325, 0.23, 0.587, 0.36 ]
},
{
"time": 0.6896,
"time": 1.3735,
"x": 28.89,
"y": -114.62,
"curve": [ 0.383, 0.23, 0.736, 0.55 ]
},
{
"time": 0.8965,
"time": 1.7856,
"x": -76.58,
"y": -124.98,
"curve": [ 0.129, 0.21, 0.547, 0.64 ]
},
{
"time": 1.1034,
"time": 2.1977,
"x": -154.37,
"y": -77.13,
"curve": [ 0.354, 0.48, 0.729, 0.9 ]
},
{
"time": 1.3103,
"time": 2.6097,
"x": -181.02,
"y": 18.56,
"curve": [ 0.063, 0.15, 0.52, 0.62 ]
},
{
"time": 1.5862,
"time": 3.1591,
"x": -150.38,
"y": 128.67,
"curve": [ 0.381, 0.54, 0.778, 1 ]
},
{
"time": 1.7931,
"time": 3.5712,
"x": -112.08,
"y": 146.28,
"curve": [ 0.242, 0, 0.626, 0.45 ]
},
{
"time": 1.931,
"time": 3.8459,
"x": -63.7,
"y": 111.22,
"curve": [ 0.398, 0.35, 0.786, 0.76 ]
},
{
"time": 2.1379,
"time": 4.258,
"x": -48.94,
"y": -1.55,
"curve": [ 0.188, 0.21, 0.575, 0.61 ]
},
{
"time": 2.3448,
"time": 4.6701,
"x": -91.69,
"y": -91.93,
"curve": [ 0.362, 0.51, 0.766, 1 ]
},
{
"time": 2.6206,
"time": 5.2195,
"x": -142.79,
"y": -126.83,
"curve": [ 0.227, 0.34, 0.593, 0.75 ]
},
{
"time": 2.7586,
"time": 5.4942,
"x": -176.7,
"y": -98.32,
"curve": [ 0.26, 0.4, 0.612, 0.71 ]
},
{
"time": 2.8965,
"time": 5.7689,
"x": -163.95,
"y": -24.04,
"curve": [ 0.338, 0.37, 0.676, 0.71 ]
},
{
"time": 2.9655,
"time": 5.9063,
"x": -150.17,
"y": 10.71,
"curve": [ 0.387, 0.61, 0.741, 1 ]
},
{
"time": 3.1034,
"time": 6.181,
"x": -102.44,
"y": 45.92,
"curve": [ 0.31, 0.24, 0.648, 0.58 ]
},
{
"time": 3.2413,
"time": 6.4557,
"x": -53.99,
"y": 70.39,
"curve": [ 0.325, 0.29, 0.663, 0.63 ]
},
{
"time": 3.3793,
"time": 6.7304,
"x": 1.88,
"y": 55.54,
"curve": [ 0.387, 0.33, 0.769, 0.73 ]
},
{
"time": 3.5862,
"time": 7.1425,
"x": 34.26,
"y": 36.13,
"curve": [ 0.206, 0.28, 0.596, 0.67 ]
},
{
"time": 3.7931,
"time": 7.5545,
"x": 23.94,
"y": 1.01,
"curve": [ 0.373, 0.56, 0.759, 1 ]
},
{ "time": 4, "x": 0, "y": 0 }
{ "time": 7.9666, "x": 0, "y": 0 }
],
"scale": [
{ "time": 0.8275, "x": 1, "y": 1 },
{ "time": 1.3103, "x": 0.742, "y": 0.742 },
{ "time": 1.7931, "x": 1, "y": 1 },
{ "time": 2.1379, "x": 1.502, "y": 1.502 },
{ "time": 2.6206, "x": 1, "y": 1 },
{ "time": 2.9655, "x": 0.707, "y": 0.707 },
{ "time": 3.3793, "x": 1, "y": 1 }
{ "time": 1.6482, "x": 1, "y": 1 },
{ "time": 2.6097, "x": 0.742, "y": 0.742 },
{ "time": 3.5712, "x": 1, "y": 1 },
{ "time": 4.258, "x": 1.502, "y": 1.502 },
{ "time": 5.2195, "x": 1, "y": 1 },
{ "time": 5.9063, "x": 0.707, "y": 0.707 },
{ "time": 6.7304, "x": 1, "y": 1 }
]
}
},
"events": [
{ "time": 0, "name": "headPop", "string": "pop.wav" },
{ "time": 1.3103, "name": "behind" },
{ "time": 2.9655, "name": "behind" },
{ "time": 4, "name": "headAttach", "string": "attach.wav" }
],
"draworder": [
{
"time": 0.6206,
"time": 1.2362,
"offsets": [
{ "slot": "head", "offset": -12 },
{ "slot": "eyes", "offset": -12 }
]
},
{
"time": 1.7931,
"time": 3.5712,
"offsets": [
{ "slot": "head", "offset": 3 },
{ "slot": "eyes", "offset": 3 }
]
},
{
"time": 2.6206,
"time": 5.2195,
"offsets": [
{ "slot": "head", "offset": -12 },
{ "slot": "eyes", "offset": -12 }
]
},
{ "time": 3.5862 }
{ "time": 7.1425 }
],
"events": [
{ "time": 0, "name": "headPop", "string": "pop.wav" },
{ "time": 2.6097, "name": "behind" },
{ "time": 5.9063, "name": "behind" },
{ "time": 7.9666, "name": "headAttach", "string": "attach.wav" }
]
},
"jump": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -57,11 +57,12 @@ public class AnimationStateTest extends ApplicationAdapter {
camera = new OrthographicCamera();
batch = new SpriteBatch();
renderer = new SkeletonRenderer();
renderer.setPremultipliedAlpha(true);
debugRenderer = new SkeletonRendererDebug();
atlas = new TextureAtlas(Gdx.files.internal("spineboy.atlas"));
SkeletonJson json = new SkeletonJson(atlas); // This loads skeleton JSON data.
SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy.json")); // SkeletonData is stateless.
atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy.atlas"));
SkeletonJson json = new SkeletonJson(atlas); // This loads skeleton JSON data, which is stateless.
SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy.json"));
skeleton = new Skeleton(skeletonData); // Skeleton holds skeleton state (bone positions, slot attachments, etc).
skeleton.setX(250);
@ -92,7 +93,7 @@ public class AnimationStateTest extends ApplicationAdapter {
System.out.println(trackIndex + " end: " + state.getCurrent(trackIndex));
}
});
state.setAnimation(0, "drawOrder", true);
state.setAnimation(0, "headPop", true);
Gdx.input.setInputProcessor(new InputAdapter() {
final Vector3 point = new Vector3();

View File

@ -56,7 +56,7 @@ import com.badlogic.gdx.utils.Array;
public class Box2DExample extends ApplicationAdapter {
SpriteBatch batch;
ShapeRenderer renderer;
SkeletonRenderer skeletonRenderer = new SkeletonRenderer();
SkeletonRenderer skeletonRenderer;
TextureAtlas atlas;
Skeleton skeleton;
@ -74,8 +74,10 @@ public class Box2DExample extends ApplicationAdapter {
public void create () {
batch = new SpriteBatch();
renderer = new ShapeRenderer();
skeletonRenderer = new SkeletonRenderer();
skeletonRenderer.setPremultipliedAlpha(true);
atlas = new TextureAtlas(Gdx.files.internal("spineboy.atlas"));
atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy.atlas"));
// This loader creates Box2dAttachments instead of RegionAttachments for an easy way to keep
// track of the Box2D body for each attachment.
@ -90,7 +92,7 @@ public class Box2DExample extends ApplicationAdapter {
};
SkeletonJson json = new SkeletonJson(atlasLoader);
json.setScale(0.05f);
SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy.json"));
SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy.json"));
animation = skeletonData.findAnimation("walk");
skeleton = new Skeleton(skeletonData);

View File

@ -52,9 +52,10 @@ public class MixTest extends ApplicationAdapter {
public void create () {
batch = new SpriteBatch();
renderer = new SkeletonRenderer();
renderer.setPremultipliedAlpha(true);
debugRenderer = new SkeletonRendererDebug();
final String name = "spineboy";
final String name = "spineboy/spineboy";
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal(name + ".atlas"));

View File

@ -68,13 +68,13 @@ public class NormalMapTest extends ApplicationAdapter {
batch.setShader(program);
renderer = new SkeletonRenderer();
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("spineboy-diffuse.atlas"));
TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy-diffuse.atlas"));
atlasTexture = atlas.getRegions().first().getTexture();
normalMapTexture = new Texture(Gdx.files.internal("spineboy-normal.png"));
normalMapTexture = new Texture(Gdx.files.internal("spineboy/spineboy-normal.png"));
SkeletonJson json = new SkeletonJson(atlas);
// json.setScale(2);
skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy.json"));
skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy.json"));
animation = skeletonData.findAnimation("walk");
skeleton = new Skeleton(skeletonData);

View File

@ -28,9 +28,13 @@
package com.esotericsoftware.spine;
import static com.badlogic.gdx.scenes.scene2d.actions.Actions.*;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
@ -42,33 +46,64 @@ import com.badlogic.gdx.graphics.g2d.PolygonSpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.Touchable;
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.List;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Slider;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup;
import com.badlogic.gdx.scenes.scene2d.ui.Window;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Array;
import java.awt.FileDialog;
import java.awt.Frame;
import java.io.File;
public class SkeletonTest extends ApplicationAdapter {
UI ui;
PolygonSpriteBatch batch;
float time;
SkeletonRenderer renderer;
SkeletonRendererDebug debugRenderer;
SkeletonData skeletonData;
Skeleton skeleton;
Animation animation;
Array<Event> events = new Array();
AnimationState state;
int skeletonX, skeletonY;
FileHandle skeletonFile;
long lastModified;
float lastModifiedCheck;
public void create () {
ui = new UI();
batch = new PolygonSpriteBatch();
renderer = new SkeletonRenderer();
debugRenderer = new SkeletonRendererDebug();
skeletonX = (int)(ui.window.getWidth() + (Gdx.graphics.getWidth() - ui.window.getWidth()) / 2);
skeletonY = Gdx.graphics.getHeight() / 4;
final String name = "goblins"; // "spineboy";
loadSkeleton(Gdx.files.internal(Gdx.app.getPreferences("spine-skeletontest")
.getString("lastFile", "spineboy/spineboy.json")));
}
void loadSkeleton (FileHandle skeletonFile) {
if (skeletonFile == null) return;
// A regular texture atlas would normally usually be used. This returns a white image for images not found in the atlas.
Pixmap pixmap = new Pixmap(32, 32, Format.RGBA8888);
pixmap.setColor(Color.WHITE);
pixmap.setColor(new Color(1, 1, 1, 0.33f));
pixmap.fill();
final AtlasRegion fake = new AtlasRegion(new Texture(pixmap), 0, 0, 32, 32);
pixmap.dispose();
FileHandle atlasFile = Gdx.files.internal(name + ".atlas");
FileHandle atlasFile = skeletonFile.sibling(skeletonFile.nameWithoutExtension() + ".atlas");
TextureAtlasData data = !atlasFile.exists() ? null : new TextureAtlasData(atlasFile, atlasFile.parent(), false);
TextureAtlas atlas = new TextureAtlas(data) {
public AtlasRegion findRegion (String name) {
@ -77,73 +112,351 @@ public class SkeletonTest extends ApplicationAdapter {
}
};
if (true) {
System.out.println("JSON");
SkeletonJson json = new SkeletonJson(atlas);
// json.setScale(2);
skeletonData = json.readSkeletonData(Gdx.files.internal(name + ".json"));
} else {
System.out.println("Binary");
SkeletonBinary binary = new SkeletonBinary(atlas);
// binary.setScale(2);
skeletonData = binary.readSkeletonData(Gdx.files.internal(name + ".skel"));
try {
if (skeletonFile.extension().equalsIgnoreCase("json")) {
SkeletonJson json = new SkeletonJson(atlas);
json.setScale(ui.scaleSlider.getValue());
skeletonData = json.readSkeletonData(skeletonFile);
} else {
SkeletonBinary binary = new SkeletonBinary(atlas);
binary.setScale(ui.scaleSlider.getValue());
skeletonData = binary.readSkeletonData(skeletonFile);
}
} catch (Exception ex) {
ex.printStackTrace();
ui.toast("Error loading skeleton: spineboy");
lastModifiedCheck = 5;
return;
}
animation = skeletonData.findAnimation("walk");
skeleton = new Skeleton(skeletonData);
if (name.equals("goblins")) skeleton.setSkin("goblin");
skeleton.setToSetupPose();
skeleton = new Skeleton(skeleton);
skeleton.updateWorldTransform();
Gdx.input.setInputProcessor(new InputAdapter() {
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
keyDown(0);
return true;
}
state = new AnimationState(new AnimationStateData(skeletonData));
public boolean keyDown (int keycode) {
if (name.equals("goblins")) {
skeleton.setSkin(skeleton.getSkin().getName().equals("goblin") ? "goblingirl" : "goblin");
skeleton.setSlotsToSetupPose();
}
return true;
}
});
this.skeletonFile = skeletonFile;
Preferences prefs = Gdx.app.getPreferences("spine-skeletontest");
prefs.putString("lastFile", skeletonFile.path());
prefs.flush();
lastModified = skeletonFile.lastModified();
lastModifiedCheck = 0.250f;
// Populate UI.
ui.skeletonLabel.setText(skeletonFile.name());
{
Array<String> items = new Array();
for (Skin skin : skeletonData.getSkins())
items.add(skin.getName());
ui.skinList.setItems(items);
}
{
Array<String> items = new Array();
for (Animation animation : skeletonData.getAnimations())
items.add(animation.getName());
ui.animationList.setItems(items);
}
// Configure skeleton from UI.
skeleton.setSkin(ui.skinList.getSelected());
skeleton.setSlotsToSetupPose();
state.setAnimation(0, ui.animationList.getSelected(), ui.loopCheckbox.isChecked());
}
public void render () {
float lastTime = time;
time += Gdx.graphics.getDeltaTime();
float x = skeleton.getX() + 160 * Gdx.graphics.getDeltaTime() * (skeleton.getFlipX() ? -1 : 1);
if (x > Gdx.graphics.getWidth()) skeleton.setFlipX(true);
if (x < 0) skeleton.setFlipX(false);
skeleton.setX(x);
skeleton.setX(300);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
events.clear();
animation.apply(skeleton, lastTime, time, true, events);
if (events.size > 0) System.out.println(events);
if (skeleton != null) {
lastModifiedCheck -= Gdx.graphics.getDeltaTime();
if (lastModifiedCheck < 0 && lastModified != skeletonFile.lastModified()) loadSkeleton(skeletonFile);
skeleton.updateWorldTransform();
skeleton.update(Gdx.graphics.getDeltaTime());
state.getData().setDefaultMix(ui.mixSlider.getValue());
renderer.setPremultipliedAlpha(ui.premultipliedCheckbox.isChecked());
batch.begin();
renderer.draw(batch, skeleton);
batch.end();
float delta = Math.min(Gdx.graphics.getDeltaTime(), 0.032f) * ui.speedSlider.getValue();
skeleton.update(delta);
if (!ui.pauseButton.isChecked()) {
state.update(delta);
state.apply(skeleton);
}
skeleton.updateWorldTransform();
skeleton.setX(skeletonX);
skeleton.setY(skeletonY);
skeleton.setFlipX(ui.flipXCheckbox.isChecked());
skeleton.setFlipY(ui.flipYCheckbox.isChecked());
//debugRenderer.draw(skeleton);
batch.begin();
renderer.draw(batch, skeleton);
batch.end();
debugRenderer.setBones(ui.debugBonesCheckbox.isChecked());
debugRenderer.setRegionAttachments(ui.debugRegionsCheckbox.isChecked());
debugRenderer.setBoundingBoxes(ui.debugBoundingBoxesCheckbox.isChecked());
debugRenderer.draw(skeleton);
}
ui.stage.act();
ui.stage.draw();
}
public void resize (int width, int height) {
batch.getProjectionMatrix().setToOrtho2D(0, 0, width, height);
debugRenderer.getShapeRenderer().setProjectionMatrix(batch.getProjectionMatrix());
ui.stage.setViewport(width, height);
if (!ui.minimizeButton.isChecked()) ui.window.setHeight(height);
}
class UI {
Stage stage = new Stage();
com.badlogic.gdx.scenes.scene2d.ui.Skin skin = new com.badlogic.gdx.scenes.scene2d.ui.Skin(
Gdx.files.internal("skin/skin.json"));
Window window = new Window("Skeleton", skin);
Table root = new Table(skin);
TextButton browseButton = new TextButton("Browse", skin);
Label skeletonLabel = new Label("", skin);
List<String> animationList = new List(skin);
List<String> skinList = new List(skin);
CheckBox loopCheckbox = new CheckBox(" Loop", skin);
CheckBox premultipliedCheckbox = new CheckBox(" Premultiplied", skin);
Slider mixSlider = new Slider(0f, 2, 0.01f, false, skin);
Label mixLabel = new Label("0.3", skin);
Slider speedSlider = new Slider(0.1f, 3, 0.01f, false, skin);
Label speedLabel = new Label("1.0", skin);
CheckBox flipXCheckbox = new CheckBox(" X", skin);
CheckBox flipYCheckbox = new CheckBox(" Y", skin);
CheckBox debugBonesCheckbox = new CheckBox(" Bones", skin);
CheckBox debugRegionsCheckbox = new CheckBox(" Regions", skin);
CheckBox debugBoundingBoxesCheckbox = new CheckBox(" Bounds", skin);
Slider scaleSlider = new Slider(0.1f, 3, 0.01f, false, skin);
Label scaleLabel = new Label("1.0", skin);
TextButton pauseButton = new TextButton("Pause", skin, "toggle");
TextButton minimizeButton = new TextButton("-", skin);
TextButton bonesSetupPoseButton = new TextButton("Bones", skin);
TextButton slotsSetupPoseButton = new TextButton("Slots", skin);
TextButton setupPoseButton = new TextButton("Both", skin);
WidgetGroup toasts = new WidgetGroup();
public UI () {
// Configure widgets.
premultipliedCheckbox.setChecked(true);
loopCheckbox.setChecked(true);
scaleSlider.setValue(1);
scaleSlider.setSnapToValues(new float[] {1}, 0.1f);
mixSlider.setValue(0.3f);
speedSlider.setValue(1);
speedSlider.setSnapToValues(new float[] {1}, 0.1f);
window.setMovable(false);
window.setResizable(false);
minimizeButton.padTop(-2).padLeft(5);
minimizeButton.getColor().a = 0.66f;
window.getButtonTable().add(minimizeButton).size(20, 20);
// Layout.
root.pad(2, 4, 4, 4).defaults().space(6);
root.columnDefaults(0).top().right();
root.columnDefaults(1).left();
root.row().padTop(6);
root.add("Skeleton:");
{
Table table = table();
table.add(skeletonLabel).fillX().expandX();
table.add(browseButton);
root.add(table).fill().row();
}
root.add("Scale:");
{
Table table = table();
table.add(scaleLabel).width(29);
table.add(scaleSlider).fillX().expandX();
root.add(table).fill().row();
}
root.add("Flip:");
root.add(table(flipXCheckbox, flipYCheckbox)).row();
root.add("Debug:");
root.add(table(debugBonesCheckbox, debugRegionsCheckbox, debugBoundingBoxesCheckbox)).row();
root.add("Alpha:");
root.add(premultipliedCheckbox).row();
root.add("Skin:");
root.add(new ScrollPane(skinList, skin)).expand().fill().minHeight(75).row();
root.add("Setup Pose:");
root.add(table(bonesSetupPoseButton, slotsSetupPoseButton, setupPoseButton)).row();
root.add("Animation:");
root.add(new ScrollPane(animationList, skin)).expand().fill().minHeight(75).row();
root.add("Mix:");
{
Table table = table();
table.add(mixLabel).width(29);
table.add(mixSlider).fillX().expandX();
root.add(table).fill().row();
}
root.add("Speed:");
{
Table table = table();
table.add(speedLabel).width(29);
table.add(speedSlider).fillX().expandX();
root.add(table).fill().row();
}
root.add("Playback:");
root.add(table(pauseButton, loopCheckbox)).row();
window.add(root).expand().fill();
window.pack();
stage.addActor(window);
{
Table table = new Table(skin);
table.setFillParent(true);
table.setTouchable(Touchable.disabled);
stage.addActor(table);
table.pad(10).bottom().right();
table.add(toasts);
table.debug();
}
// Events.
window.addListener(new InputListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
event.cancel();
return true;
}
});
browseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
FileDialog fileDialog = new FileDialog((Frame)null, "Choose skeleton file");
fileDialog.setMode(FileDialog.LOAD);
fileDialog.setVisible(true);
String name = fileDialog.getFile();
String dir = fileDialog.getDirectory();
if (name == null || dir == null) return;
loadSkeleton(new FileHandle(new File(dir, name).getAbsolutePath()));
}
});
setupPoseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) skeleton.setToSetupPose();
}
});
bonesSetupPoseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) skeleton.setBonesToSetupPose();
}
});
slotsSetupPoseButton.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) skeleton.setSlotsToSetupPose();
}
});
minimizeButton.addListener(new ClickListener() {
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
event.cancel();
return super.touchDown(event, x, y, pointer, button);
}
public void clicked (InputEvent event, float x, float y) {
if (minimizeButton.isChecked()) {
window.getCells().get(0).setWidget(null);
window.setHeight(20);
minimizeButton.setText("+");
} else {
window.getCells().get(0).setWidget(root);
ui.window.setHeight(Gdx.graphics.getHeight());
minimizeButton.setText("-");
}
}
});
scaleSlider.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
scaleLabel.setText(Float.toString((int)(scaleSlider.getValue() * 100) / 100f));
if (!scaleSlider.isDragging()) loadSkeleton(skeletonFile);
}
});
speedSlider.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
speedLabel.setText(Float.toString((int)(speedSlider.getValue() * 100) / 100f));
}
});
mixSlider.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
mixLabel.setText(Float.toString((int)(mixSlider.getValue() * 100) / 100f));
if (state != null) state.getData().setDefaultMix(mixSlider.getValue());
}
});
animationList.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (state != null) state.setAnimation(0, animationList.getSelected(), loopCheckbox.isChecked());
}
});
skinList.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if (skeleton != null) {
skeleton.setSkin(skinList.getSelected());
skeleton.setSlotsToSetupPose();
}
}
});
Gdx.input.setInputProcessor(new InputMultiplexer(stage, new InputAdapter() {
public boolean touchDown (int screenX, int screenY, int pointer, int button) {
touchDragged(screenX, screenY, pointer);
return false;
}
public boolean touchDragged (int screenX, int screenY, int pointer) {
skeletonX = screenX;
skeletonY = Gdx.graphics.getHeight() - screenY;
return false;
}
}));
}
private Table table (Actor... actors) {
Table table = new Table();
table.defaults().space(6);
table.add(actors);
return table;
}
void toast (String text) {
Table table = new Table();
table.add(new Label(text, skin));
table.getColor().a = 0;
table.pack();
table.setPosition(-table.getWidth(), -3 - table.getHeight());
table.addAction(sequence( //
parallel(moveBy(0, table.getHeight(), 0.3f), fadeIn(0.3f)), //
delay(5f), //
parallel(moveBy(0, table.getHeight(), 0.3f), fadeOut(0.3f)), //
removeActor() //
));
for (Actor actor : toasts.getChildren())
actor.addAction(moveBy(0, table.getHeight(), 0.3f));
toasts.addActor(table);
toasts.getParent().toFront();
}
}
public static void main (String[] args) throws Exception {
new LwjglApplication(new SkeletonTest());
new LwjglApplication(new SkeletonTest(), "SkeletonTest", 800, 600, true);
}
}

View File

@ -1,531 +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": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 },
{ "name": "right upper leg", "parent": "hip", "length": 42.45, "x": -20.07, "y": -6.83, "rotation": -97.49 },
{ "name": "torso", "parent": "hip", "length": 85.82, "x": -6.42, "y": 1.97, "rotation": 93.92 },
{ "name": "left lower leg", "parent": "left upper leg", "length": 49.89, "x": 56.34, "y": 0.98, "rotation": -16.65 },
{ "name": "left shoulder", "parent": "torso", "length": 35.43, "x": 74.04, "y": -20.38, "rotation": -156.96 },
{ "name": "neck", "parent": "torso", "length": 18.38, "x": 81.67, "y": -6.34, "rotation": -1.51 },
{ "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 42.99, "y": -0.61, "rotation": -14.34 },
{ "name": "right shoulder", "parent": "torso", "length": 37.24, "x": 76.02, "y": 18.14, "rotation": 133.88 },
{ "name": "head", "parent": "neck", "length": 68.28, "x": 20.93, "y": 11.59, "rotation": -13.92, "color": "d48387ff" },
{ "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 37.85, "y": -2.34, "rotation": 28.16 },
{ "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 58.94, "y": -7.61, "rotation": 102.43 },
{ "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 37.6, "y": 0.31, "rotation": 36.32 },
{ "name": "right foot", "parent": "right lower leg", "length": 45.45, "x": 64.88, "y": 0.04, "rotation": 110.3 },
{ "name": "left hand", "parent": "left arm", "length": 11.52, "x": 35.62, "y": 0.07, "rotation": 2.7 },
{ "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }
],
"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": "goblin/head" },
{ "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 }
},
"torso": {
"goblin/head": {
"type": "mesh",
"vertices": [ 87.34, -39.83, 109.98, 60.57, 174.32, 46.07, 151.68, -54.33 ],
"triangles": [ 1, 2, 3, 1, 3, 0 ],
"uvs": [ 1, 1, 0, 1, 0, 0, 1, 0 ],
"edges": [ 0, 2, 2, 4, 4, 6, 0, 6 ],
"hull": 8,
"width": 103,
"height": 66
}
}
},
"goblin": {
"eyes": {
"eyes closed": { "name": "goblin/eyes-closed", "x": 32.21, "y": -21.27, "rotation": -88.92, "width": 34, "height": 12 }
},
"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 foot": {
"left foot": { "name": "goblin/left-foot", "x": 24.85, "y": 8.74, "rotation": 3.32, "width": 65, "height": 31 }
},
"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
}
},
"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 shoulder": {
"left shoulder": { "name": "goblin/left-shoulder", "x": 15.56, "y": -2.26, "rotation": 62.01, "width": 29, "height": 44 }
},
"left upper leg": {
"left upper leg": { "name": "goblin/left-upper-leg", "x": 29.68, "y": -3.87, "rotation": 89.09, "width": 33, "height": 73 }
},
"neck": {
"neck": { "name": "goblin/neck", "x": 10.1, "y": 0.42, "rotation": -93.69, "width": 36, "height": 41 }
},
"pelvis": {
"pelvis": { "name": "goblin/pelvis", "x": -5.61, "y": 0.76, "width": 62, "height": 43 }
},
"right arm": {
"right arm": { "name": "goblin/right-arm", "x": 16.44, "y": -1.04, "rotation": 94.32, "width": 23, "height": 50 }
},
"right foot": {
"right foot": { "name": "goblin/right-foot", "x": 23.56, "y": 9.8, "rotation": 1.52, "width": 63, "height": 33 }
},
"right hand": {
"right hand": { "name": "goblin/right-hand", "x": 7.88, "y": 2.78, "rotation": 91.96, "width": 36, "height": 37 }
},
"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 shoulder": {
"right shoulder": { "name": "goblin/right-shoulder", "x": 15.68, "y": -1.03, "rotation": 130.65, "width": 39, "height": 45 }
},
"right upper leg": {
"right upper leg": { "name": "goblin/right-upper-leg", "x": 20.35, "y": 1.47, "rotation": 97.49, "width": 34, "height": 63 }
},
"torso": {
"torso": { "name": "goblin/torso", "x": 38.09, "y": -3.87, "rotation": -94.95, "width": 68, "height": 96 }
},
"undie straps": {
"undie straps": { "name": "goblin/undie-straps", "x": -3.87, "y": 13.1, "scaleX": 1.089, "width": 55, "height": 19 }
},
"undies": {
"undies": { "name": "goblin/undies", "x": 6.3, "y": 0.12, "rotation": 0.91, "width": 36, "height": 29 }
}
},
"goblingirl": {
"eyes": {
"eyes closed": { "name": "goblingirl/eyes-closed", "x": 28, "y": -25.54, "rotation": -87.04, "width": 37, "height": 21 }
},
"head": {
"head": { "name": "goblingirl/head", "x": 27.71, "y": -4.32, "rotation": -85.58, "width": 103, "height": 81 }
},
"left arm": {
"left arm": { "name": "goblingirl/left-arm", "x": 19.64, "y": -2.42, "rotation": 33.05, "width": 37, "height": 35 }
},
"left foot": {
"left foot": { "name": "goblingirl/left-foot", "x": 25.17, "y": 7.92, "rotation": 3.32, "width": 65, "height": 31 }
},
"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
}
},
"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 shoulder": {
"left shoulder": { "name": "goblingirl/left-shoulder", "x": 19.8, "y": -0.42, "rotation": 61.21, "width": 28, "height": 46 }
},
"left upper leg": {
"left upper leg": { "name": "goblingirl/left-upper-leg", "x": 30.21, "y": -2.95, "rotation": 89.09, "width": 33, "height": 70 }
},
"neck": {
"neck": { "name": "goblingirl/neck", "x": 6.16, "y": -3.14, "rotation": -98.86, "width": 35, "height": 41 }
},
"pelvis": {
"pelvis": { "name": "goblingirl/pelvis", "x": -3.87, "y": 3.18, "width": 62, "height": 43 }
},
"right arm": {
"right arm": { "name": "goblingirl/right-arm", "x": 16.85, "y": -0.66, "rotation": 93.52, "width": 28, "height": 50 }
},
"right foot": {
"right foot": { "name": "goblingirl/right-foot", "x": 23.46, "y": 9.66, "rotation": 1.52, "width": 63, "height": 33 }
},
"right hand": {
"right hand": { "name": "goblingirl/right-hand", "x": 7.21, "y": 3.43, "rotation": 91.16, "width": 36, "height": 37 }
},
"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 shoulder": {
"right shoulder": { "name": "goblingirl/right-shoulder", "x": 14.46, "y": 0.45, "rotation": 129.85, "width": 39, "height": 45 }
},
"right upper leg": {
"right upper leg": { "name": "goblingirl/right-upper-leg", "x": 19.69, "y": 2.13, "rotation": 97.49, "width": 34, "height": 63 }
},
"torso": {
"torso": { "name": "goblingirl/torso", "x": 36.28, "y": -5.14, "rotation": -95.74, "width": 68, "height": 96 }
},
"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 }
}
}
},
"events": {
"test1": { "int": 1, "float": 2, "string": "three" },
"test2": {}
},
"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 }
]
}
},
"ffd": {
"default": {
"torso": {
"goblin/head": [
{ "time": 0 },
{
"time": 0.5,
"vertices": [ 78.53, -53.55, 96.74, 63.46, 197.1, 24.55, 144.41, -37.48 ]
},
{ "time": 1 }
]
}
}
},
"slots": {
"head": {
"color": [
{ "time": 0.1, "color": "ffffffff" },
{ "time": 0.8, "color": "fcff00ff" }
]
}
},
"events": [
{ "time": 0.4666, "name": "test1" },
{ "time": 0.5333, "name": "test2" },
{ "time": 0.9333, "name": "test1" }
]
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB