diff --git a/spine-corona/examples/dragon.lua b/spine-corona/examples/dragon.lua new file mode 100644 index 000000000..c9e879da8 --- /dev/null +++ b/spine-corona/examples/dragon.lua @@ -0,0 +1,38 @@ + +local spine = require "spine-corona.spine" + +local json = spine.SkeletonJson.new() +json.scale = 0.5 +local skeletonData = json:readSkeletonDataFile("examples/dragon/dragon.json") + +local skeleton = spine.Skeleton.new(skeletonData) +function skeleton:createImage (attachment) + return display.newImage("examples/dragon/images/" .. attachment.name .. ".png") +end +skeleton.group.x = 160 +skeleton.group.y = 225 +skeleton.flipX = false +skeleton.flipY = false +skeleton.debug = true -- Omit or set to false to not draw debug lines on top of the images. +skeleton:setToSetupPose() + +-- AnimationStateData defines crossfade durations between animations. +local stateData = spine.AnimationStateData.new(skeletonData) +-- AnimationState has a queue of animations and can apply them with crossfading. +local state = spine.AnimationState.new(stateData) +state:setAnimation("flying", true) + +local lastTime = 0 +local animationTime = 0 +Runtime:addEventListener("enterFrame", function (event) + -- Compute time in seconds since last frame. + local currentTime = event.time / 1000 + local delta = currentTime - lastTime + lastTime = currentTime + + -- Update the state with the delta time, apply it, and update the world transforms. + state:update(delta) + state:apply(skeleton) + skeleton:updateWorldTransform() +end) + diff --git a/spine-corona/examples/dragon/dragon.atlas b/spine-corona/examples/dragon/dragon.atlas new file mode 100644 index 000000000..089eba72e --- /dev/null +++ b/spine-corona/examples/dragon/dragon.atlas @@ -0,0 +1,290 @@ + +dragon.png +format: RGBA4444 +filter: Nearest,Nearest +repeat: none +L_rear_thigh + rotate: false + xy: 895, 20 + size: 91, 148 + orig: 91, 149 + offset: 0, 0 + index: -1 +L_wing01 + rotate: false + xy: 814, 672 + size: 191, 256 + orig: 191, 256 + offset: 0, 0 + index: -1 +L_wing02 + rotate: false + xy: 714, 189 + size: 179, 269 + orig: 179, 269 + offset: 0, 0 + index: -1 +L_wing03 + rotate: false + xy: 785, 463 + size: 186, 207 + orig: 186, 207 + offset: 0, 0 + index: -1 +L_wing05 + rotate: true + xy: 2, 9 + size: 218, 213 + orig: 218, 213 + offset: 0, 0 + index: -1 +L_wing06 + rotate: false + xy: 2, 229 + size: 192, 331 + orig: 192, 331 + offset: 0, 0 + index: -1 +R_wing01 + rotate: true + xy: 502, 709 + size: 219, 310 + orig: 219, 310 + offset: 0, 0 + index: -1 +R_wing02 + rotate: true + xy: 204, 463 + size: 203, 305 + orig: 203, 305 + offset: 0, 0 + index: -1 +R_wing03 + rotate: false + xy: 511, 460 + size: 272, 247 + orig: 272, 247 + offset: 0, 0 + index: -1 +R_wing05 + rotate: false + xy: 196, 232 + size: 251, 229 + orig: 251, 229 + offset: 0, 0 + index: -1 +R_wing06 + rotate: false + xy: 2, 562 + size: 200, 366 + orig: 200, 366 + offset: 0, 0 + index: -1 +R_wing07 + rotate: true + xy: 449, 258 + size: 200, 263 + orig: 200, 263 + offset: 0, 0 + index: -1 +R_wing08 + rotate: false + xy: 467, 2 + size: 234, 254 + orig: 234, 254 + offset: 0, 0 + index: -1 +R_wing09 + rotate: false + xy: 217, 26 + size: 248, 204 + orig: 248, 204 + offset: 0, 0 + index: -1 +back + rotate: false + xy: 703, 2 + size: 190, 185 + orig: 190, 185 + offset: 0, 0 + index: -1 +chest + rotate: true + xy: 895, 170 + size: 136, 122 + orig: 136, 122 + offset: 0, 0 + index: -1 +front_toeA + rotate: false + xy: 976, 972 + size: 29, 50 + orig: 29, 50 + offset: 0, 0 + index: -1 +head + rotate: false + xy: 204, 668 + size: 296, 260 + orig: 296, 260 + offset: 0, 0 + index: -1 +logo + rotate: false + xy: 2, 930 + size: 897, 92 + orig: 897, 92 + offset: 0, 0 + index: -1 +tail01 + rotate: false + xy: 895, 308 + size: 120, 153 + orig: 120, 153 + offset: 0, 0 + index: -1 +tail03 + rotate: false + xy: 901, 930 + size: 73, 92 + orig: 73, 92 + offset: 0, 0 + index: -1 + +dragon2.png +format: RGBA4444 +filter: Nearest,Nearest +repeat: none +L_front_leg + rotate: true + xy: 391, 141 + size: 84, 57 + orig: 84, 57 + offset: 0, 0 + index: -1 +L_front_thigh + rotate: false + xy: 446, 269 + size: 84, 72 + orig: 84, 72 + offset: 0, 0 + index: -1 +L_rear_leg + rotate: true + xy: 888, 342 + size: 168, 132 + orig: 206, 177 + offset: 19, 20 + index: -1 +L_wing04 + rotate: false + xy: 256, 227 + size: 188, 135 + orig: 188, 135 + offset: 0, 0 + index: -1 +L_wing07 + rotate: false + xy: 2, 109 + size: 159, 255 + orig: 159, 255 + offset: 0, 0 + index: -1 +L_wing08 + rotate: true + xy: 705, 346 + size: 164, 181 + orig: 164, 181 + offset: 0, 0 + index: -1 +L_wing09 + rotate: false + xy: 499, 343 + size: 204, 167 + orig: 204, 167 + offset: 0, 0 + index: -1 +R_front_leg + rotate: false + xy: 273, 34 + size: 101, 89 + orig: 101, 89 + offset: 0, 0 + index: -1 +R_front_thigh + rotate: false + xy: 163, 106 + size: 108, 108 + orig: 108, 108 + offset: 0, 0 + index: -1 +R_rear_leg + rotate: false + xy: 273, 125 + size: 116, 100 + orig: 116, 100 + offset: 0, 0 + index: -1 +R_rear_thigh + rotate: false + xy: 163, 216 + size: 91, 148 + orig: 91, 149 + offset: 0, 0 + index: -1 +R_wing04 + rotate: false + xy: 2, 366 + size: 279, 144 + orig: 279, 144 + offset: 0, 0 + index: -1 +chin + rotate: false + xy: 283, 364 + size: 214, 146 + orig: 214, 146 + offset: 0, 0 + index: -1 +front_toeB + rotate: false + xy: 590, 284 + size: 56, 57 + orig: 56, 57 + offset: 0, 0 + index: -1 +rear-toe + rotate: true + xy: 2, 2 + size: 105, 77 + orig: 109, 77 + offset: 0, 0 + index: -1 +tail02 + rotate: true + xy: 151, 9 + size: 95, 120 + orig: 95, 120 + offset: 0, 0 + index: -1 +tail04 + rotate: false + xy: 532, 270 + size: 56, 71 + orig: 56, 71 + offset: 0, 0 + index: -1 +tail05 + rotate: false + xy: 648, 282 + size: 52, 59 + orig: 52, 59 + offset: 0, 0 + index: -1 +tail06 + rotate: true + xy: 81, 12 + size: 95, 68 + orig: 95, 68 + offset: 0, 0 + index: -1 diff --git a/spine-corona/examples/dragon/dragon.json b/spine-corona/examples/dragon/dragon.json new file mode 100644 index 000000000..c27a105c5 --- /dev/null +++ b/spine-corona/examples/dragon/dragon.json @@ -0,0 +1,783 @@ +{ +"bones": [ + { "name": "root", "y": -176.12 }, + { "name": "COG", "parent": "root", "y": 176.12 }, + { "name": "back", "parent": "COG", "length": 115.37, "x": 16.03, "y": 27.94, "rotation": 151.83 }, + { "name": "chest", "parent": "COG", "length": 31.24, "x": 52.52, "y": 15.34, "rotation": 161.7 }, + { "name": "neck", "parent": "COG", "length": 41.36, "x": 64.75, "y": 11.98, "rotation": 39.05 }, + { "name": "L_front_thigh", "parent": "chest", "length": 67.42, "x": -45.58, "y": 7.92, "rotation": 138.94 }, + { "name": "L_wing", "parent": "chest", "length": 301.12, "x": -7.24, "y": -24.65, "rotation": -75.51 }, + { "name": "R_front_thigh", "parent": "chest", "length": 81.63, "x": -10.89, "y": 28.25, "rotation": 67.96 }, + { "name": "R_rear_thigh", "parent": "back", "length": 123.46, "x": 65.31, "y": 59.89, "rotation": 104.87 }, + { "name": "chin", "parent": "neck", "length": 153.15, "x": 64.62, "y": -6.99, "rotation": -69.07 }, + { "name": "head", "parent": "neck", "length": 188.83, "x": 69.96, "y": 2.49, "rotation": 8.06 }, + { "name": "tail1", "parent": "back", "length": 65.65, "x": 115.37, "y": -0.19, "rotation": 44.31 }, + { "name": "L_front_leg", "parent": "L_front_thigh", "length": 51.57, "x": 67.42, "y": 0.02, "rotation": 43.36 }, + { "name": "L_rear_thigh", "parent": "R_rear_thigh", "length": 88.05, "x": -8.59, "y": 30.18, "rotation": 28.35 }, + { "name": "R_front_leg", "parent": "R_front_thigh", "length": 66.52, "x": 83.04, "y": -0.3, "rotation": 92.7 }, + { "name": "R_rear_leg", "parent": "R_rear_thigh", "length": 91.06, "x": 123.46, "y": -0.26, "rotation": -129.04 }, + { "name": "R_wing", "parent": "head", "length": 359.5, "x": -74.68, "y": 20.9, "rotation": 83.21 }, + { "name": "tail2", "parent": "tail1", "length": 54.5, "x": 65.65, "y": 0.22, "rotation": 12 }, + { "name": "L_front_toe1", "parent": "L_front_leg", "length": 51.44, "x": 45.53, "y": 2.43, "rotation": -98 }, + { "name": "L_front_toe2", "parent": "L_front_leg", "length": 61.97, "x": 51.57, "y": -0.12, "rotation": -55.26 }, + { "name": "L_front_toe3", "parent": "L_front_leg", "length": 45.65, "x": 54.19, "y": 0.6, "scaleX": 1.134, "rotation": -11.13 }, + { "name": "L_front_toe4", "parent": "L_front_leg", "length": 53.47, "x": 50.6, "y": 7.08, "scaleX": 1.134, "rotation": 19.42 }, + { "name": "L_rear_leg", "parent": "L_rear_thigh", "length": 103.74, "x": 96.04, "y": -0.97, "rotation": -122.41 }, + { "name": "R_front_toe1", "parent": "R_front_leg", "length": 46.65, "x": 70.03, "y": 5.31, "rotation": 8.59 }, + { "name": "R_front_toe2", "parent": "R_front_leg", "length": 53.66, "x": 66.52, "y": 0.33, "rotation": -35.02 }, + { "name": "R_front_toe3", "parent": "R_front_leg", "length": 58.38, "x": 62.1, "y": -0.79, "rotation": -74.67 }, + { "name": "R_rear_toe1", "parent": "R_rear_leg", "length": 94.99, "x": 90.06, "y": 2.12, "rotation": 141.98 }, + { "name": "R_rear_toe2", "parent": "R_rear_leg", "length": 99.29, "x": 89.6, "y": 1.52, "rotation": 125.32 }, + { "name": "R_rear_toe3", "parent": "R_rear_leg", "length": 103.45, "x": 91.06, "y": -0.35, "rotation": 112.26 }, + { "name": "tail3", "parent": "tail2", "length": 41.78, "x": 54.5, "y": 0.37, "rotation": 1.8 }, + { "name": "tail4", "parent": "tail3", "length": 34.19, "x": 41.78, "y": 0.16, "rotation": -1.8 }, + { "name": "tail5", "parent": "tail4", "length": 32.32, "x": 34.19, "y": -0.19, "rotation": -3.15 }, + { "name": "tail6", "parent": "tail5", "length": 80.08, "x": 32.32, "y": -0.23, "rotation": -29.55 } +], +"slots": [ + { "name": "L_rear_leg", "bone": "L_rear_leg", "attachment": "L_rear_leg" }, + { "name": "L_rear_thigh", "bone": "L_rear_thigh", "attachment": "L_rear_thigh" }, + { "name": "L_wing", "bone": "L_wing", "attachment": "L_wing01" }, + { "name": "tail6", "bone": "tail6", "attachment": "tail06" }, + { "name": "tail5", "bone": "tail5", "attachment": "tail05" }, + { "name": "tail4", "bone": "tail4", "attachment": "tail04" }, + { "name": "tail3", "bone": "tail3", "attachment": "tail03" }, + { "name": "tail2", "bone": "tail2", "attachment": "tail02" }, + { "name": "tail1", "bone": "tail1", "attachment": "tail01" }, + { "name": "back", "bone": "back", "attachment": "back" }, + { "name": "L_front_thigh", "bone": "L_front_thigh", "attachment": "L_front_thigh" }, + { "name": "L_front_leg", "bone": "L_front_leg", "attachment": "L_front_leg" }, + { "name": "L_front_toe1", "bone": "L_front_toe1", "attachment": "front_toeA" }, + { "name": "L_front_toe4", "bone": "L_front_toe4", "attachment": "front_toeB" }, + { "name": "L_front_toe3", "bone": "L_front_toe3", "attachment": "front_toeB" }, + { "name": "L_front_toe2", "bone": "L_front_toe2", "attachment": "front_toeB" }, + { "name": "chest", "bone": "chest", "attachment": "chest" }, + { "name": "R_rear_toe1", "bone": "R_rear_toe1", "attachment": "rear-toe" }, + { "name": "R_rear_toe2", "bone": "R_rear_toe2", "attachment": "rear-toe" }, + { "name": "R_rear_toe3", "bone": "R_rear_toe3", "attachment": "rear-toe" }, + { "name": "R_rear_leg", "bone": "R_rear_leg", "attachment": "R_rear_leg" }, + { "name": "R_rear_thigh", "bone": "R_rear_thigh", "attachment": "R_rear_thigh" }, + { "name": "R_front_toe1", "bone": "R_front_toe1", "attachment": "front_toeB" }, + { "name": "R_front_thigh", "bone": "R_front_thigh", "attachment": "R_front_thigh" }, + { "name": "R_front_leg", "bone": "R_front_leg", "attachment": "R_front_leg" }, + { "name": "R_front_toe2", "bone": "R_front_toe2", "attachment": "front_toeB" }, + { "name": "R_front_toe3", "bone": "R_front_toe3", "attachment": "front_toeB" }, + { "name": "chin", "bone": "chin", "attachment": "chin" }, + { "name": "R_wing", "bone": "R_wing", "attachment": "R_wing01" }, + { "name": "head", "bone": "head", "attachment": "head" }, + { "name": "logo", "bone": "root", "attachment": "logo" } +], +"skins": { + "default": { + "L_front_leg": { + "L_front_leg": { "x": 14.68, "y": 0.48, "rotation": 15.99, "width": 84, "height": 57 } + }, + "L_front_thigh": { + "L_front_thigh": { "x": 27.66, "y": -11.58, "rotation": 58.66, "width": 84, "height": 72 } + }, + "L_front_toe1": { + "front_toeA": { "x": 31.92, "y": 0.61, "rotation": 109.55, "width": 29, "height": 50 } + }, + "L_front_toe2": { + "front_toeB": { "x": 26.83, "y": -4.94, "rotation": 109.51, "width": 56, "height": 57 } + }, + "L_front_toe3": { + "front_toeB": { "x": 18.21, "y": -7.21, "scaleX": 0.881, "scaleY": 0.94, "rotation": 99.71, "width": 56, "height": 57 } + }, + "L_front_toe4": { + "front_toeB": { "x": 23.21, "y": -11.68, "scaleX": 0.881, "rotation": 79.89, "width": 56, "height": 57 } + }, + "L_rear_leg": { + "L_rear_leg": { "x": 67.29, "y": 12.62, "rotation": -162.65, "width": 206, "height": 177 } + }, + "L_rear_thigh": { + "L_rear_thigh": { "x": 56.03, "y": 27.38, "rotation": 74.93, "width": 91, "height": 149 } + }, + "L_wing": { + "L_wing01": { "x": 129.21, "y": -45.49, "rotation": -83.7, "width": 191, "height": 256 }, + "L_wing02": { "x": 126.37, "y": -31.69, "rotation": -86.18, "width": 179, "height": 269 }, + "L_wing03": { "x": 110.26, "y": -90.89, "rotation": -86.18, "width": 186, "height": 207 }, + "L_wing04": { "x": -61.61, "y": -83.26, "rotation": -86.18, "width": 188, "height": 135 }, + "L_wing05": { "x": -90.01, "y": -78.14, "rotation": -86.18, "width": 218, "height": 213 }, + "L_wing06": { "x": -143.76, "y": -83.71, "rotation": -86.18, "width": 192, "height": 331 }, + "L_wing07": { "x": -133.04, "y": -33.89, "rotation": -86.18, "width": 159, "height": 255 }, + "L_wing08": { "x": 50.15, "y": -15.71, "rotation": -86.18, "width": 164, "height": 181 }, + "L_wing09": { "x": 85.94, "y": -11.32, "rotation": -86.18, "width": 204, "height": 167 } + }, + "R_front_leg": { + "R_front_leg": { "x": 17.79, "y": 4.22, "rotation": 37.62, "width": 101, "height": 89 } + }, + "R_front_thigh": { + "R_front_thigh": { "x": 35.28, "y": 2.11, "rotation": 130.33, "width": 108, "height": 108 } + }, + "R_front_toe1": { + "front_toeB": { "x": 24.49, "y": -2.61, "rotation": 104.18, "width": 56, "height": 57 } + }, + "R_front_toe2": { + "front_toeB": { "x": 26.39, "y": 1.16, "rotation": 104.57, "width": 56, "height": 57 } + }, + "R_front_toe3": { + "front_toeB": { "x": 30.66, "y": -0.06, "rotation": 112.29, "width": 56, "height": 57 } + }, + "R_rear_leg": { + "R_rear_leg": { "x": 60.87, "y": -5.72, "rotation": -127.66, "width": 116, "height": 100 } + }, + "R_rear_thigh": { + "R_rear_thigh": { "x": 53.25, "y": 12.58, "rotation": 103.29, "width": 91, "height": 149 } + }, + "R_rear_toe1": { + "rear-toe": { "x": 54.75, "y": -5.72, "rotation": 134.79, "width": 109, "height": 77 } + }, + "R_rear_toe2": { + "rear-toe": { "x": 57.02, "y": -7.22, "rotation": 134.42, "width": 109, "height": 77 } + }, + "R_rear_toe3": { + "rear-toe": { "x": 47.46, "y": -7.64, "rotation": 134.34, "width": 109, "height": 77 } + }, + "R_wing": { + "R_wing01": { "x": 170.08, "y": -23.67, "rotation": -130.33, "width": 219, "height": 310 }, + "R_wing02": { "x": 171.14, "y": -19.33, "rotation": -130.33, "width": 203, "height": 305 }, + "R_wing03": { "x": 166.46, "y": 29.23, "rotation": -130.33, "width": 272, "height": 247 }, + "R_wing04": { "x": 42.94, "y": 134.05, "rotation": -130.33, "width": 279, "height": 144 }, + "R_wing05": { "x": -8.83, "y": 142.59, "rotation": -130.33, "width": 251, "height": 229 }, + "R_wing06": { "x": -123.33, "y": 111.22, "rotation": -130.33, "width": 200, "height": 366 }, + "R_wing07": { "x": -40.17, "y": 118.03, "rotation": -130.33, "width": 200, "height": 263 }, + "R_wing08": { "x": 48.01, "y": 28.76, "rotation": -130.33, "width": 234, "height": 254 }, + "R_wing09": { "x": 128.1, "y": 21.12, "rotation": -130.33, "width": 248, "height": 204 } + }, + "back": { + "back": { "x": 35.84, "y": 19.99, "rotation": -151.83, "width": 190, "height": 185 } + }, + "chest": { + "chest": { "x": -14.6, "y": 24.78, "rotation": -161.7, "width": 136, "height": 122 } + }, + "chin": { + "chin": { "x": 66.55, "y": 7.32, "rotation": 30.01, "width": 214, "height": 146 } + }, + "head": { + "head": { "x": 76.68, "y": 32.21, "rotation": -47.12, "width": 296, "height": 260 } + }, + "logo": { + "logo": { "y": -176.72, "width": 897, "height": 92 } + }, + "tail1": { + "tail01": { "x": 22.59, "y": -4.5, "rotation": 163.85, "width": 120, "height": 153 } + }, + "tail2": { + "tail02": { "x": 18.11, "y": -1.75, "rotation": 151.84, "width": 95, "height": 120 } + }, + "tail3": { + "tail03": { "x": 16.94, "y": -2, "rotation": 150.04, "width": 73, "height": 92 } + }, + "tail4": { + "tail04": { "x": 15.34, "y": -2.17, "rotation": 151.84, "width": 56, "height": 71 } + }, + "tail5": { + "tail05": { "x": 15.05, "y": -3.57, "rotation": 155, "width": 52, "height": 59 } + }, + "tail6": { + "tail06": { "x": 28.02, "y": -16.83, "rotation": -175.44, "width": 95, "height": 68 } + } + } +}, +"animations": { + "flying": { + "bones": { + "back": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 17.39 }, + { "time": 0.5, "angle": 0 }, + { "time": 0.8333, "angle": 7 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "neck": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -8.18 }, + { "time": 0.3333, "angle": -23.16 }, + { "time": 0.5, "angle": -18.01 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "chest": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 0.5, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "tail1": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -2.42 }, + { "time": 0.3333, "angle": -26.2 }, + { "time": 0.5, "angle": -29.65 }, + { "time": 0.6666, "angle": -23.15 }, + { "time": 0.8333, "angle": -55.46 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_rear_thigh": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 0.5, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "tail2": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -1.12 }, + { "time": 0.3333, "angle": 10.48 }, + { "time": 0.5, "angle": 7.89 }, + { "time": 0.8333, "angle": -10.38 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "tail3": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 8.24 }, + { "time": 0.3333, "angle": 15.21 }, + { "time": 0.5, "angle": 14.84 }, + { "time": 0.8333, "angle": -18.9 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "tail4": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 17.46 }, + { "time": 0.3333, "angle": 22.15 }, + { "time": 0.5, "angle": 22.76 }, + { "time": 0.8333, "angle": -4.37 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "tail5": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 7.4 }, + { "time": 0.3333, "angle": 28.5 }, + { "time": 0.5, "angle": 21.33 }, + { "time": 0.8333, "angle": -1.27 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "tail6": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 45.99 }, + { "time": 0.4, "angle": 43.53 }, + { "time": 0.5, "angle": 61.79 }, + { "time": 0.8333, "angle": 13.28 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_rear_leg": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -14.21 }, + { "time": 0.5, "angle": 47.17 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_rear_toe3": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.5, "angle": -36.06 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_rear_toe2": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.5, "angle": -20.32 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_rear_toe1": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.5, "angle": -18.71 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "head": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [ 0.408, 1.36, 0.675, 1.43 ] + }, + { "time": 0.5, "angle": 1.03 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "chin": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [ 0.416, 1.15, 0.494, 1.27 ] + }, + { "time": 0.3333, "angle": -5.15 }, + { "time": 0.5, "angle": 9.79 }, + { "time": 0.6666, "angle": 18.94 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_front_thigh": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -19.18 }, + { "time": 0.3333, "angle": -32.02 }, + { "time": 0.5, "angle": -19.62 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_front_thigh": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -12.96 }, + { "time": 0.5, "angle": 16.2 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_front_leg": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 37.77 }, + { "time": 0.5, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_front_toe1": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": -16.08 }, + { "time": 0.5, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_front_toe2": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 0.5, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 }, + { "time": 0.5, "x": 1.33, "y": 1.029 }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_front_toe4": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.5, "angle": 26.51 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 }, + { "time": 0.5, "x": 1.239, "y": 0.993 }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_front_toe3": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.5, "angle": 16.99 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 }, + { "time": 0.5, "x": 1.402, "y": 1.007 }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_front_leg": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 26.07 }, + { "time": 0.5, "angle": -21.6 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.5, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_front_toe1": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 29.23 }, + { "time": 0.5, "angle": 34.83 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 }, + { "time": 0.5, "x": 1.412, "y": 1 }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_front_toe2": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 24.89 }, + { "time": 0.5, "angle": 23.16 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 }, + { "time": 0.5, "x": 1.407, "y": 1.057 }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "R_front_toe3": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1666, "angle": 11.01 }, + { "time": 0.5, "angle": 0, "curve": "stepped" }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.5, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 1, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 }, + { "time": 0.5, "x": 1.329, "y": 1.181 }, + { "time": 1, "x": 1, "y": 1 } + ] + }, + "L_rear_leg": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.3666, "angle": 25.19 }, + { "time": 0.6666, "angle": -15.65 }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1 } + ] + }, + "COG": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [ 0.456, 0.2, 0.422, 1.06 ] + }, + { "time": 0.3333, "angle": 23.93 }, + { + "time": 0.6666, + "angle": 337.8, + "curve": [ 0.41, 0, 0.887, 0.75 ] + }, + { "time": 1, "angle": 0 } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": 0, + "curve": [ 0.33, 1, 0.816, 1.33 ] + }, + { + "time": 0.5, + "x": 0, + "y": 113.01, + "curve": [ 0.396, 0, 0.709, 2.03 ] + }, + { "time": 1, "x": 0, "y": 0 } + ] + } + }, + "slots": { + "L_wing": { + "attachment": [ + { "time": 0, "name": "L_wing01" }, + { "time": 0.0666, "name": "L_wing02" }, + { "time": 0.1333, "name": "L_wing03" }, + { "time": 0.2, "name": "L_wing04" }, + { "time": 0.2666, "name": "L_wing05" }, + { "time": 0.3333, "name": "L_wing06" }, + { "time": 0.4, "name": "L_wing07" }, + { "time": 0.4666, "name": "L_wing08" }, + { "time": 0.5333, "name": "L_wing09" }, + { "time": 0.6, "name": "L_wing01" }, + { "time": 0.7333, "name": "L_wing02" }, + { "time": 0.8, "name": "L_wing03" }, + { "time": 0.8333, "name": "L_wing04" }, + { "time": 0.8666, "name": "L_wing05" }, + { "time": 0.9, "name": "L_wing06" }, + { "time": 0.9333, "name": "L_wing07" }, + { "time": 0.9666, "name": "L_wing08" }, + { "time": 1, "name": "L_wing09" } + ] + }, + "R_wing": { + "attachment": [ + { "time": 0, "name": "R_wing01" }, + { "time": 0.0666, "name": "R_wing02" }, + { "time": 0.1333, "name": "R_wing03" }, + { "time": 0.2, "name": "R_wing04" }, + { "time": 0.2666, "name": "R_wing05" }, + { "time": 0.3333, "name": "R_wing06" }, + { "time": 0.4, "name": "R_wing07" }, + { "time": 0.4666, "name": "R_wing08" }, + { "time": 0.5333, "name": "R_wing09" }, + { "time": 0.6, "name": "R_wing01" }, + { "time": 0.7333, "name": "R_wing02" }, + { "time": 0.7666, "name": "R_wing02" }, + { "time": 0.8, "name": "R_wing03" }, + { "time": 0.8333, "name": "R_wing04" }, + { "time": 0.8666, "name": "R_wing05" }, + { "time": 0.9, "name": "R_wing06" }, + { "time": 0.9333, "name": "R_wing07" }, + { "time": 0.9666, "name": "R_wing08" }, + { "time": 1, "name": "R_wing09" } + ] + } + } + } +} +} \ No newline at end of file diff --git a/spine-corona/examples/dragon/images/L_front_leg.png b/spine-corona/examples/dragon/images/L_front_leg.png new file mode 100644 index 000000000..4a8b204d2 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_front_leg.png differ diff --git a/spine-corona/examples/dragon/images/L_front_thigh.png b/spine-corona/examples/dragon/images/L_front_thigh.png new file mode 100644 index 000000000..5b691a879 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_front_thigh.png differ diff --git a/spine-corona/examples/dragon/images/L_rear_leg.png b/spine-corona/examples/dragon/images/L_rear_leg.png new file mode 100644 index 000000000..fc00ab6ea Binary files /dev/null and b/spine-corona/examples/dragon/images/L_rear_leg.png differ diff --git a/spine-corona/examples/dragon/images/L_rear_thigh.png b/spine-corona/examples/dragon/images/L_rear_thigh.png new file mode 100644 index 000000000..4c363aa38 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_rear_thigh.png differ diff --git a/spine-corona/examples/dragon/images/L_wing01.png b/spine-corona/examples/dragon/images/L_wing01.png new file mode 100644 index 000000000..3a12127ee Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing01.png differ diff --git a/spine-corona/examples/dragon/images/L_wing02.png b/spine-corona/examples/dragon/images/L_wing02.png new file mode 100644 index 000000000..831d7ca9a Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing02.png differ diff --git a/spine-corona/examples/dragon/images/L_wing03.png b/spine-corona/examples/dragon/images/L_wing03.png new file mode 100644 index 000000000..702c43f78 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing03.png differ diff --git a/spine-corona/examples/dragon/images/L_wing04.png b/spine-corona/examples/dragon/images/L_wing04.png new file mode 100644 index 000000000..5cba4670b Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing04.png differ diff --git a/spine-corona/examples/dragon/images/L_wing05.png b/spine-corona/examples/dragon/images/L_wing05.png new file mode 100644 index 000000000..d8d18c2a6 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing05.png differ diff --git a/spine-corona/examples/dragon/images/L_wing06.png b/spine-corona/examples/dragon/images/L_wing06.png new file mode 100644 index 000000000..788c70b3f Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing06.png differ diff --git a/spine-corona/examples/dragon/images/L_wing07.png b/spine-corona/examples/dragon/images/L_wing07.png new file mode 100644 index 000000000..c055793f7 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing07.png differ diff --git a/spine-corona/examples/dragon/images/L_wing08.png b/spine-corona/examples/dragon/images/L_wing08.png new file mode 100644 index 000000000..dc16d0081 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing08.png differ diff --git a/spine-corona/examples/dragon/images/L_wing09.png b/spine-corona/examples/dragon/images/L_wing09.png new file mode 100644 index 000000000..97e915803 Binary files /dev/null and b/spine-corona/examples/dragon/images/L_wing09.png differ diff --git a/spine-corona/examples/dragon/images/R_front_leg.png b/spine-corona/examples/dragon/images/R_front_leg.png new file mode 100644 index 000000000..bcc28eece Binary files /dev/null and b/spine-corona/examples/dragon/images/R_front_leg.png differ diff --git a/spine-corona/examples/dragon/images/R_front_thigh.png b/spine-corona/examples/dragon/images/R_front_thigh.png new file mode 100644 index 000000000..fbf13cfe0 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_front_thigh.png differ diff --git a/spine-corona/examples/dragon/images/R_rear_leg.png b/spine-corona/examples/dragon/images/R_rear_leg.png new file mode 100644 index 000000000..c2cc5e72f Binary files /dev/null and b/spine-corona/examples/dragon/images/R_rear_leg.png differ diff --git a/spine-corona/examples/dragon/images/R_rear_thigh.png b/spine-corona/examples/dragon/images/R_rear_thigh.png new file mode 100644 index 000000000..ade9cde61 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_rear_thigh.png differ diff --git a/spine-corona/examples/dragon/images/R_wing01.png b/spine-corona/examples/dragon/images/R_wing01.png new file mode 100644 index 000000000..873bf075f Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing01.png differ diff --git a/spine-corona/examples/dragon/images/R_wing02.png b/spine-corona/examples/dragon/images/R_wing02.png new file mode 100644 index 000000000..60dd18943 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing02.png differ diff --git a/spine-corona/examples/dragon/images/R_wing03.png b/spine-corona/examples/dragon/images/R_wing03.png new file mode 100644 index 000000000..1cf2e1c79 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing03.png differ diff --git a/spine-corona/examples/dragon/images/R_wing04.png b/spine-corona/examples/dragon/images/R_wing04.png new file mode 100644 index 000000000..316aa4e61 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing04.png differ diff --git a/spine-corona/examples/dragon/images/R_wing05.png b/spine-corona/examples/dragon/images/R_wing05.png new file mode 100644 index 000000000..73fdb42e6 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing05.png differ diff --git a/spine-corona/examples/dragon/images/R_wing06.png b/spine-corona/examples/dragon/images/R_wing06.png new file mode 100644 index 000000000..931ca659b Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing06.png differ diff --git a/spine-corona/examples/dragon/images/R_wing07.png b/spine-corona/examples/dragon/images/R_wing07.png new file mode 100644 index 000000000..3d7af824b Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing07.png differ diff --git a/spine-corona/examples/dragon/images/R_wing08.png b/spine-corona/examples/dragon/images/R_wing08.png new file mode 100644 index 000000000..f6d28d383 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing08.png differ diff --git a/spine-corona/examples/dragon/images/R_wing09.png b/spine-corona/examples/dragon/images/R_wing09.png new file mode 100644 index 000000000..f97a87653 Binary files /dev/null and b/spine-corona/examples/dragon/images/R_wing09.png differ diff --git a/spine-corona/examples/dragon/images/back.png b/spine-corona/examples/dragon/images/back.png new file mode 100644 index 000000000..05531bc55 Binary files /dev/null and b/spine-corona/examples/dragon/images/back.png differ diff --git a/spine-corona/examples/dragon/images/chest.png b/spine-corona/examples/dragon/images/chest.png new file mode 100644 index 000000000..6e3ba44ec Binary files /dev/null and b/spine-corona/examples/dragon/images/chest.png differ diff --git a/spine-corona/examples/dragon/images/chin.png b/spine-corona/examples/dragon/images/chin.png new file mode 100644 index 000000000..68c76488a Binary files /dev/null and b/spine-corona/examples/dragon/images/chin.png differ diff --git a/spine-corona/examples/dragon/images/front_toeA.png b/spine-corona/examples/dragon/images/front_toeA.png new file mode 100644 index 000000000..f021032ec Binary files /dev/null and b/spine-corona/examples/dragon/images/front_toeA.png differ diff --git a/spine-corona/examples/dragon/images/front_toeB.png b/spine-corona/examples/dragon/images/front_toeB.png new file mode 100644 index 000000000..0b48c237c Binary files /dev/null and b/spine-corona/examples/dragon/images/front_toeB.png differ diff --git a/spine-corona/examples/dragon/images/head.png b/spine-corona/examples/dragon/images/head.png new file mode 100644 index 000000000..5e4e436fa Binary files /dev/null and b/spine-corona/examples/dragon/images/head.png differ diff --git a/spine-corona/examples/dragon/images/license.txt b/spine-corona/examples/dragon/images/license.txt new file mode 100644 index 000000000..41ebddd5b --- /dev/null +++ b/spine-corona/examples/dragon/images/license.txt @@ -0,0 +1,5 @@ +Copyright (c) 2013, ODI EntertainmenT + +The project file and images in this "dragon" project are provided for +demonstration purposes only and may not be redistributed for any reason nor +used as the basis for derivative work. \ No newline at end of file diff --git a/spine-corona/examples/dragon/images/logo.png b/spine-corona/examples/dragon/images/logo.png new file mode 100644 index 000000000..cf43dad28 Binary files /dev/null and b/spine-corona/examples/dragon/images/logo.png differ diff --git a/spine-corona/examples/dragon/images/rear-toe.png b/spine-corona/examples/dragon/images/rear-toe.png new file mode 100644 index 000000000..e4c7fa870 Binary files /dev/null and b/spine-corona/examples/dragon/images/rear-toe.png differ diff --git a/spine-corona/examples/dragon/images/tail01.png b/spine-corona/examples/dragon/images/tail01.png new file mode 100644 index 000000000..e9bcef7fc Binary files /dev/null and b/spine-corona/examples/dragon/images/tail01.png differ diff --git a/spine-corona/examples/dragon/images/tail02.png b/spine-corona/examples/dragon/images/tail02.png new file mode 100644 index 000000000..8b31a9362 Binary files /dev/null and b/spine-corona/examples/dragon/images/tail02.png differ diff --git a/spine-corona/examples/dragon/images/tail03.png b/spine-corona/examples/dragon/images/tail03.png new file mode 100644 index 000000000..aa09539f8 Binary files /dev/null and b/spine-corona/examples/dragon/images/tail03.png differ diff --git a/spine-corona/examples/dragon/images/tail04.png b/spine-corona/examples/dragon/images/tail04.png new file mode 100644 index 000000000..2aeeed4fe Binary files /dev/null and b/spine-corona/examples/dragon/images/tail04.png differ diff --git a/spine-corona/examples/dragon/images/tail05.png b/spine-corona/examples/dragon/images/tail05.png new file mode 100644 index 000000000..f41005c53 Binary files /dev/null and b/spine-corona/examples/dragon/images/tail05.png differ diff --git a/spine-corona/examples/dragon/images/tail06.png b/spine-corona/examples/dragon/images/tail06.png new file mode 100644 index 000000000..31f68a4d2 Binary files /dev/null and b/spine-corona/examples/dragon/images/tail06.png differ diff --git a/spine-corona/examples/goblins.lua b/spine-corona/examples/goblins.lua new file mode 100644 index 000000000..fbc5a20f4 --- /dev/null +++ b/spine-corona/examples/goblins.lua @@ -0,0 +1,40 @@ + +-- This example shows how to use skins. + +local spine = require "spine-corona.spine" + +local json = spine.SkeletonJson.new() +json.scale = 1 +local skeletonData = json:readSkeletonDataFile("examples/goblins/goblins.json") + +local skeleton = spine.Skeleton.new(skeletonData) +function skeleton:createImage (attachment) + return display.newImage("examples/goblins/images/" .. attachment.name .. ".png") +end +skeleton.group.x = 150 +skeleton.group.y = 325 +skeleton.flipX = false +skeleton.flipY = false +skeleton.debug = true -- Omit or set to false to not draw debug lines on top of the images. +skeleton:setSkin("goblingirl") +skeleton:setToSetupPose() -- Required after changing skin to attach attachments from skin. + +-- AnimationState has a queue of animations and can apply them with crossfading. +local stateData = spine.AnimationStateData.new(skeletonData) +local state = spine.AnimationState.new(stateData) +state:setAnimation("walk", true) + +local lastTime = 0 +local animationTime = 0 +Runtime:addEventListener("enterFrame", function (event) + -- Compute time in seconds since last frame. + local currentTime = event.time / 1000 + local delta = currentTime - lastTime + lastTime = currentTime + + -- Update the state with the delta time, apply it, and update the world transforms. + state:update(delta) + state:apply(skeleton) + skeleton:updateWorldTransform() +end) + diff --git a/spine-corona/data/goblins/goblins.json b/spine-corona/examples/goblins/goblins.json similarity index 100% rename from spine-corona/data/goblins/goblins.json rename to spine-corona/examples/goblins/goblins.json diff --git a/spine-corona/data/goblins/dagger.png b/spine-corona/examples/goblins/images/dagger.png similarity index 100% rename from spine-corona/data/goblins/dagger.png rename to spine-corona/examples/goblins/images/dagger.png diff --git a/spine-corona/data/goblins/goblin/eyes-closed.png b/spine-corona/examples/goblins/images/goblin/eyes-closed.png similarity index 100% rename from spine-corona/data/goblins/goblin/eyes-closed.png rename to spine-corona/examples/goblins/images/goblin/eyes-closed.png diff --git a/spine-corona/data/goblins/goblin/head.png b/spine-corona/examples/goblins/images/goblin/head.png similarity index 100% rename from spine-corona/data/goblins/goblin/head.png rename to spine-corona/examples/goblins/images/goblin/head.png diff --git a/spine-corona/data/goblins/goblin/left-arm.png b/spine-corona/examples/goblins/images/goblin/left-arm.png similarity index 100% rename from spine-corona/data/goblins/goblin/left-arm.png rename to spine-corona/examples/goblins/images/goblin/left-arm.png diff --git a/spine-corona/data/goblins/goblin/left-foot.png b/spine-corona/examples/goblins/images/goblin/left-foot.png similarity index 100% rename from spine-corona/data/goblins/goblin/left-foot.png rename to spine-corona/examples/goblins/images/goblin/left-foot.png diff --git a/spine-corona/data/goblins/goblin/left-hand.png b/spine-corona/examples/goblins/images/goblin/left-hand.png similarity index 100% rename from spine-corona/data/goblins/goblin/left-hand.png rename to spine-corona/examples/goblins/images/goblin/left-hand.png diff --git a/spine-corona/data/goblins/goblin/left-lower-leg.png b/spine-corona/examples/goblins/images/goblin/left-lower-leg.png similarity index 100% rename from spine-corona/data/goblins/goblin/left-lower-leg.png rename to spine-corona/examples/goblins/images/goblin/left-lower-leg.png diff --git a/spine-corona/data/goblins/goblin/left-shoulder.png b/spine-corona/examples/goblins/images/goblin/left-shoulder.png similarity index 100% rename from spine-corona/data/goblins/goblin/left-shoulder.png rename to spine-corona/examples/goblins/images/goblin/left-shoulder.png diff --git a/spine-corona/data/goblins/goblin/left-upper-leg.png b/spine-corona/examples/goblins/images/goblin/left-upper-leg.png similarity index 100% rename from spine-corona/data/goblins/goblin/left-upper-leg.png rename to spine-corona/examples/goblins/images/goblin/left-upper-leg.png diff --git a/spine-corona/data/goblins/goblin/neck.png b/spine-corona/examples/goblins/images/goblin/neck.png similarity index 100% rename from spine-corona/data/goblins/goblin/neck.png rename to spine-corona/examples/goblins/images/goblin/neck.png diff --git a/spine-corona/data/goblins/goblin/pelvis.png b/spine-corona/examples/goblins/images/goblin/pelvis.png similarity index 100% rename from spine-corona/data/goblins/goblin/pelvis.png rename to spine-corona/examples/goblins/images/goblin/pelvis.png diff --git a/spine-corona/data/goblins/goblin/right-arm.png b/spine-corona/examples/goblins/images/goblin/right-arm.png similarity index 100% rename from spine-corona/data/goblins/goblin/right-arm.png rename to spine-corona/examples/goblins/images/goblin/right-arm.png diff --git a/spine-corona/data/goblins/goblin/right-foot.png b/spine-corona/examples/goblins/images/goblin/right-foot.png similarity index 100% rename from spine-corona/data/goblins/goblin/right-foot.png rename to spine-corona/examples/goblins/images/goblin/right-foot.png diff --git a/spine-corona/data/goblins/goblin/right-hand.png b/spine-corona/examples/goblins/images/goblin/right-hand.png similarity index 100% rename from spine-corona/data/goblins/goblin/right-hand.png rename to spine-corona/examples/goblins/images/goblin/right-hand.png diff --git a/spine-corona/data/goblins/goblin/right-lower-leg.png b/spine-corona/examples/goblins/images/goblin/right-lower-leg.png similarity index 100% rename from spine-corona/data/goblins/goblin/right-lower-leg.png rename to spine-corona/examples/goblins/images/goblin/right-lower-leg.png diff --git a/spine-corona/data/goblins/goblin/right-shoulder.png b/spine-corona/examples/goblins/images/goblin/right-shoulder.png similarity index 100% rename from spine-corona/data/goblins/goblin/right-shoulder.png rename to spine-corona/examples/goblins/images/goblin/right-shoulder.png diff --git a/spine-corona/data/goblins/goblin/right-upper-leg.png b/spine-corona/examples/goblins/images/goblin/right-upper-leg.png similarity index 100% rename from spine-corona/data/goblins/goblin/right-upper-leg.png rename to spine-corona/examples/goblins/images/goblin/right-upper-leg.png diff --git a/spine-corona/data/goblins/goblin/torso.png b/spine-corona/examples/goblins/images/goblin/torso.png similarity index 100% rename from spine-corona/data/goblins/goblin/torso.png rename to spine-corona/examples/goblins/images/goblin/torso.png diff --git a/spine-corona/data/goblins/goblin/undie-straps.png b/spine-corona/examples/goblins/images/goblin/undie-straps.png similarity index 100% rename from spine-corona/data/goblins/goblin/undie-straps.png rename to spine-corona/examples/goblins/images/goblin/undie-straps.png diff --git a/spine-corona/data/goblins/goblin/undies.png b/spine-corona/examples/goblins/images/goblin/undies.png similarity index 100% rename from spine-corona/data/goblins/goblin/undies.png rename to spine-corona/examples/goblins/images/goblin/undies.png diff --git a/spine-corona/data/goblins/goblingirl/eyes-closed.png b/spine-corona/examples/goblins/images/goblingirl/eyes-closed.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/eyes-closed.png rename to spine-corona/examples/goblins/images/goblingirl/eyes-closed.png diff --git a/spine-corona/data/goblins/goblingirl/head.png b/spine-corona/examples/goblins/images/goblingirl/head.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/head.png rename to spine-corona/examples/goblins/images/goblingirl/head.png diff --git a/spine-corona/data/goblins/goblingirl/left-arm.png b/spine-corona/examples/goblins/images/goblingirl/left-arm.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/left-arm.png rename to spine-corona/examples/goblins/images/goblingirl/left-arm.png diff --git a/spine-corona/data/goblins/goblingirl/left-foot.png b/spine-corona/examples/goblins/images/goblingirl/left-foot.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/left-foot.png rename to spine-corona/examples/goblins/images/goblingirl/left-foot.png diff --git a/spine-corona/data/goblins/goblingirl/left-hand.png b/spine-corona/examples/goblins/images/goblingirl/left-hand.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/left-hand.png rename to spine-corona/examples/goblins/images/goblingirl/left-hand.png diff --git a/spine-corona/data/goblins/goblingirl/left-lower-leg.png b/spine-corona/examples/goblins/images/goblingirl/left-lower-leg.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/left-lower-leg.png rename to spine-corona/examples/goblins/images/goblingirl/left-lower-leg.png diff --git a/spine-corona/data/goblins/goblingirl/left-shoulder.png b/spine-corona/examples/goblins/images/goblingirl/left-shoulder.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/left-shoulder.png rename to spine-corona/examples/goblins/images/goblingirl/left-shoulder.png diff --git a/spine-corona/data/goblins/goblingirl/left-upper-leg.png b/spine-corona/examples/goblins/images/goblingirl/left-upper-leg.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/left-upper-leg.png rename to spine-corona/examples/goblins/images/goblingirl/left-upper-leg.png diff --git a/spine-corona/data/goblins/goblingirl/neck.png b/spine-corona/examples/goblins/images/goblingirl/neck.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/neck.png rename to spine-corona/examples/goblins/images/goblingirl/neck.png diff --git a/spine-corona/data/goblins/goblingirl/pelvis.png b/spine-corona/examples/goblins/images/goblingirl/pelvis.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/pelvis.png rename to spine-corona/examples/goblins/images/goblingirl/pelvis.png diff --git a/spine-corona/data/goblins/goblingirl/right-arm.png b/spine-corona/examples/goblins/images/goblingirl/right-arm.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/right-arm.png rename to spine-corona/examples/goblins/images/goblingirl/right-arm.png diff --git a/spine-corona/data/goblins/goblingirl/right-foot.png b/spine-corona/examples/goblins/images/goblingirl/right-foot.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/right-foot.png rename to spine-corona/examples/goblins/images/goblingirl/right-foot.png diff --git a/spine-corona/data/goblins/goblingirl/right-hand.png b/spine-corona/examples/goblins/images/goblingirl/right-hand.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/right-hand.png rename to spine-corona/examples/goblins/images/goblingirl/right-hand.png diff --git a/spine-corona/data/goblins/goblingirl/right-lower-leg.png b/spine-corona/examples/goblins/images/goblingirl/right-lower-leg.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/right-lower-leg.png rename to spine-corona/examples/goblins/images/goblingirl/right-lower-leg.png diff --git a/spine-corona/data/goblins/goblingirl/right-shoulder.png b/spine-corona/examples/goblins/images/goblingirl/right-shoulder.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/right-shoulder.png rename to spine-corona/examples/goblins/images/goblingirl/right-shoulder.png diff --git a/spine-corona/data/goblins/goblingirl/right-upper-leg.png b/spine-corona/examples/goblins/images/goblingirl/right-upper-leg.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/right-upper-leg.png rename to spine-corona/examples/goblins/images/goblingirl/right-upper-leg.png diff --git a/spine-corona/data/goblins/goblingirl/torso.png b/spine-corona/examples/goblins/images/goblingirl/torso.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/torso.png rename to spine-corona/examples/goblins/images/goblingirl/torso.png diff --git a/spine-corona/data/goblins/goblingirl/undie-straps.png b/spine-corona/examples/goblins/images/goblingirl/undie-straps.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/undie-straps.png rename to spine-corona/examples/goblins/images/goblingirl/undie-straps.png diff --git a/spine-corona/data/goblins/goblingirl/undies.png b/spine-corona/examples/goblins/images/goblingirl/undies.png similarity index 100% rename from spine-corona/data/goblins/goblingirl/undies.png rename to spine-corona/examples/goblins/images/goblingirl/undies.png diff --git a/spine-corona/data/goblins/spear.png b/spine-corona/examples/goblins/images/spear.png similarity index 100% rename from spine-corona/data/goblins/spear.png rename to spine-corona/examples/goblins/images/spear.png diff --git a/spine-corona/examples/spineboy.lua b/spine-corona/examples/spineboy.lua new file mode 100644 index 000000000..2b2b3550b --- /dev/null +++ b/spine-corona/examples/spineboy.lua @@ -0,0 +1,46 @@ + +-- This example shows simple usage of displaying a skeleton with queued animations. + +local spine = require "spine-corona.spine" + +local json = spine.SkeletonJson.new() +json.scale = 1 +local skeletonData = json:readSkeletonDataFile("examples/spineboy/spineboy.json") + +local skeleton = spine.Skeleton.new(skeletonData) +function skeleton:createImage (attachment) + -- Customize where images are loaded. + return display.newImage("examples/spineboy/images/" .. attachment.name .. ".png") +end +skeleton.group.x = 150 +skeleton.group.y = 325 +skeleton.flipX = false +skeleton.flipY = false +skeleton.debug = true -- Omit or set to false to not draw debug lines on top of the images. +skeleton:setToSetupPose() + +-- AnimationStateData defines crossfade durations between animations. +local stateData = spine.AnimationStateData.new(skeletonData) +stateData:setMix("walk", "jump", 0.2) +stateData:setMix("jump", "walk", 0.4) + +-- AnimationState has a queue of animations and can apply them with crossfading. +local state = spine.AnimationState.new(stateData) +state:setAnimation("walk", false) +state:addAnimation("jump", false) +state:addAnimation("walk", true) + +local lastTime = 0 +local animationTime = 0 +Runtime:addEventListener("enterFrame", function (event) + -- Compute time in seconds since last frame. + local currentTime = event.time / 1000 + local delta = currentTime - lastTime + lastTime = currentTime + + -- Update the state with the delta time, apply it, and update the world transforms. + state:update(delta) + state:apply(skeleton) + skeleton:updateWorldTransform() +end) + diff --git a/spine-corona/data/spineboy/eyes-closed.png b/spine-corona/examples/spineboy/images/eyes-closed.png similarity index 100% rename from spine-corona/data/spineboy/eyes-closed.png rename to spine-corona/examples/spineboy/images/eyes-closed.png diff --git a/spine-corona/data/spineboy/eyes.png b/spine-corona/examples/spineboy/images/eyes.png similarity index 100% rename from spine-corona/data/spineboy/eyes.png rename to spine-corona/examples/spineboy/images/eyes.png diff --git a/spine-corona/data/spineboy/head.png b/spine-corona/examples/spineboy/images/head.png similarity index 100% rename from spine-corona/data/spineboy/head.png rename to spine-corona/examples/spineboy/images/head.png diff --git a/spine-corona/data/spineboy/left-ankle.png b/spine-corona/examples/spineboy/images/left-ankle.png similarity index 100% rename from spine-corona/data/spineboy/left-ankle.png rename to spine-corona/examples/spineboy/images/left-ankle.png diff --git a/spine-corona/data/spineboy/left-arm.png b/spine-corona/examples/spineboy/images/left-arm.png similarity index 100% rename from spine-corona/data/spineboy/left-arm.png rename to spine-corona/examples/spineboy/images/left-arm.png diff --git a/spine-corona/data/spineboy/left-foot.png b/spine-corona/examples/spineboy/images/left-foot.png similarity index 100% rename from spine-corona/data/spineboy/left-foot.png rename to spine-corona/examples/spineboy/images/left-foot.png diff --git a/spine-corona/data/spineboy/left-hand.png b/spine-corona/examples/spineboy/images/left-hand.png similarity index 100% rename from spine-corona/data/spineboy/left-hand.png rename to spine-corona/examples/spineboy/images/left-hand.png diff --git a/spine-corona/data/spineboy/left-lower-leg.png b/spine-corona/examples/spineboy/images/left-lower-leg.png similarity index 100% rename from spine-corona/data/spineboy/left-lower-leg.png rename to spine-corona/examples/spineboy/images/left-lower-leg.png diff --git a/spine-corona/data/spineboy/left-pant-bottom.png b/spine-corona/examples/spineboy/images/left-pant-bottom.png similarity index 100% rename from spine-corona/data/spineboy/left-pant-bottom.png rename to spine-corona/examples/spineboy/images/left-pant-bottom.png diff --git a/spine-corona/data/spineboy/left-shoulder.png b/spine-corona/examples/spineboy/images/left-shoulder.png similarity index 100% rename from spine-corona/data/spineboy/left-shoulder.png rename to spine-corona/examples/spineboy/images/left-shoulder.png diff --git a/spine-corona/data/spineboy/left-upper-leg.png b/spine-corona/examples/spineboy/images/left-upper-leg.png similarity index 100% rename from spine-corona/data/spineboy/left-upper-leg.png rename to spine-corona/examples/spineboy/images/left-upper-leg.png diff --git a/spine-corona/data/spineboy/neck.png b/spine-corona/examples/spineboy/images/neck.png similarity index 100% rename from spine-corona/data/spineboy/neck.png rename to spine-corona/examples/spineboy/images/neck.png diff --git a/spine-corona/data/spineboy/pelvis.png b/spine-corona/examples/spineboy/images/pelvis.png similarity index 100% rename from spine-corona/data/spineboy/pelvis.png rename to spine-corona/examples/spineboy/images/pelvis.png diff --git a/spine-corona/data/spineboy/right-ankle.png b/spine-corona/examples/spineboy/images/right-ankle.png similarity index 100% rename from spine-corona/data/spineboy/right-ankle.png rename to spine-corona/examples/spineboy/images/right-ankle.png diff --git a/spine-corona/data/spineboy/right-arm.png b/spine-corona/examples/spineboy/images/right-arm.png similarity index 100% rename from spine-corona/data/spineboy/right-arm.png rename to spine-corona/examples/spineboy/images/right-arm.png diff --git a/spine-corona/data/spineboy/right-foot-idle.png b/spine-corona/examples/spineboy/images/right-foot-idle.png similarity index 100% rename from spine-corona/data/spineboy/right-foot-idle.png rename to spine-corona/examples/spineboy/images/right-foot-idle.png diff --git a/spine-corona/data/spineboy/right-foot.png b/spine-corona/examples/spineboy/images/right-foot.png similarity index 100% rename from spine-corona/data/spineboy/right-foot.png rename to spine-corona/examples/spineboy/images/right-foot.png diff --git a/spine-corona/data/spineboy/right-hand.png b/spine-corona/examples/spineboy/images/right-hand.png similarity index 100% rename from spine-corona/data/spineboy/right-hand.png rename to spine-corona/examples/spineboy/images/right-hand.png diff --git a/spine-corona/data/spineboy/right-lower-leg.png b/spine-corona/examples/spineboy/images/right-lower-leg.png similarity index 100% rename from spine-corona/data/spineboy/right-lower-leg.png rename to spine-corona/examples/spineboy/images/right-lower-leg.png diff --git a/spine-corona/data/spineboy/right-pant-bottom.png b/spine-corona/examples/spineboy/images/right-pant-bottom.png similarity index 100% rename from spine-corona/data/spineboy/right-pant-bottom.png rename to spine-corona/examples/spineboy/images/right-pant-bottom.png diff --git a/spine-corona/data/spineboy/right-shoulder.png b/spine-corona/examples/spineboy/images/right-shoulder.png similarity index 100% rename from spine-corona/data/spineboy/right-shoulder.png rename to spine-corona/examples/spineboy/images/right-shoulder.png diff --git a/spine-corona/data/spineboy/right-upper-leg.png b/spine-corona/examples/spineboy/images/right-upper-leg.png similarity index 100% rename from spine-corona/data/spineboy/right-upper-leg.png rename to spine-corona/examples/spineboy/images/right-upper-leg.png diff --git a/spine-corona/data/spineboy/torso.png b/spine-corona/examples/spineboy/images/torso.png similarity index 100% rename from spine-corona/data/spineboy/torso.png rename to spine-corona/examples/spineboy/images/torso.png diff --git a/spine-corona/data/spineboy/spineboy.json b/spine-corona/examples/spineboy/spineboy.json similarity index 84% rename from spine-corona/data/spineboy/spineboy.json rename to spine-corona/examples/spineboy/spineboy.json index 57b0f6cbe..113e72c33 100644 --- a/spine-corona/data/spineboy/spineboy.json +++ b/spine-corona/examples/spineboy/spineboy.json @@ -3,21 +3,21 @@ { "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": 56.45, "x": 51.78, "y": 3.46, "rotation": -16.65 }, - { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, + { "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": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, - { "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": 94.95 }, - { "name": "neck", "parent": "torso", "length": 18.38, "x": 83.64, "y": -1.78, "rotation": 0.9 }, - { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, - { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, - { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, - { "name": "right hand", "parent": "right arm", "length": 15.32, "x": 36.9, "y": 0.34, "rotation": 2.35 }, + { "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 }, + { "name": "right lower leg", "parent": "right upper leg", "length": 58.52, "x": 50.21, "y": 0.6, "rotation": -10.7 }, + { "name": "right shoulder", "parent": "torso", "length": 49.95, "x": 81.9, "y": 6.79, "rotation": 130.6 }, + { "name": "head", "parent": "neck", "length": 68.28, "x": 19.09, "y": 6.97, "rotation": -8.94 }, { "name": "left arm", "parent": "left shoulder", "length": 35.62, "x": 44.19, "y": -0.01, "rotation": 28.16 }, + { "name": "left foot", "parent": "left lower leg", "length": 46.5, "x": 64.02, "y": -8.67, "rotation": 102.43 }, + { "name": "right arm", "parent": "right shoulder", "length": 36.74, "x": 49.95, "y": -0.12, "rotation": 40.12 }, + { "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": "pelvis", "parent": "hip", "x": 1.41, "y": -6.57 } + { "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" }, @@ -34,344 +34,281 @@ { "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" }, + { "name": "right shoulder", "bone": "right shoulder", "attachment": "right-shoulder", "additive": true }, { "name": "right arm", "bone": "right arm", "attachment": "right-arm" }, - { "name": "right hand", "bone": "right hand", "attachment": "right-hand" } + { "name": "right hand", "bone": "right hand", "attachment": "right-hand" }, + { "name": "bb-head", "bone": "head", "attachment": "bb-head" } ], "skins": { "default": { - "left shoulder": { - "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } + "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 + ] + } + }, + "eyes": { + "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, + "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } + }, + "head": { + "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } }, "left arm": { "left-arm": { "x": 15.11, "y": -0.44, "rotation": 33.84, "width": 35, "height": 29 } }, - "left hand": { - "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } - }, "left foot": { "left-foot": { "x": 24.35, "y": 8.88, "rotation": 3.32, "width": 65, "height": 30 } }, + "left hand": { + "left-hand": { "x": 0.75, "y": 1.86, "rotation": 31.14, "width": 35, "height": 38 } + }, "left lower leg": { "left-lower-leg": { "x": 24.55, "y": -1.92, "rotation": 105.75, "width": 49, "height": 64 } }, + "left shoulder": { + "left-shoulder": { "x": 23.74, "y": 0.11, "rotation": 62.01, "width": 34, "height": 53 } + }, "left upper leg": { "left-upper-leg": { "x": 26.12, "y": -1.85, "rotation": 89.09, "width": 33, "height": 67 } }, + "neck": { + "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } + }, "pelvis": { "pelvis": { "x": -4.83, "y": 10.62, "width": 63, "height": 47 } }, + "right arm": { + "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } + }, "right foot": { "right-foot": { "x": 19.02, "y": 8.47, "rotation": 1.52, "width": 67, "height": 30 } }, + "right hand": { + "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } + }, "right lower leg": { "right-lower-leg": { "x": 23.28, "y": -2.59, "rotation": 111.83, "width": 51, "height": 64 } }, + "right shoulder": { + "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } + }, "right upper leg": { "right-upper-leg": { "x": 23.03, "y": 0.25, "rotation": 101.13, "width": 44, "height": 70 } }, "torso": { "torso": { "x": 44.57, "y": -7.08, "rotation": -94.95, "width": 68, "height": 92 } - }, - "neck": { - "neck": { "x": 9.42, "y": -3.66, "rotation": -100.15, "width": 34, "height": 28 } - }, - "head": { - "head": { "x": 53.94, "y": -5.75, "rotation": -86.9, "width": 121, "height": 132 } - }, - "eyes": { - "eyes": { "x": 28.94, "y": -32.92, "rotation": -86.9, "width": 34, "height": 27 }, - "eyes-closed": { "x": 28.77, "y": -32.86, "rotation": -86.9, "width": 34, "height": 27 } - }, - "right shoulder": { - "right-shoulder": { "x": 25.86, "y": 0.03, "rotation": 134.44, "width": 52, "height": 51 } - }, - "right arm": { - "right-arm": { "x": 18.34, "y": -2.64, "rotation": 94.32, "width": 21, "height": 45 } - }, - "right hand": { - "right-hand": { "x": 6.82, "y": 1.25, "rotation": 91.96, "width": 32, "height": 32 } } } }, +"events": { + "behind": {}, + "headAttach": {}, + "headPop": {} +}, "animations": { - "walk": { + "drawOrder": { "bones": { - "left upper leg": { - "rotate": [ - { "time": 0, "angle": -26.55 }, - { "time": 0.1333, "angle": -8.78 }, - { "time": 0.2666, "angle": 9.51 }, - { "time": 0.4, "angle": 30.74 }, - { "time": 0.5333, "angle": 25.33 }, - { "time": 0.6666, "angle": 26.11 }, - { "time": 0.8, "angle": -7.7 }, - { "time": 0.9333, "angle": -21.19 }, - { "time": 1.0666, "angle": -26.55 } - ], - "translate": [ - { "time": 0, "x": -3, "y": -2.25 }, - { "time": 0.4, "x": -2.18, "y": -2.25 }, - { "time": 1.0666, "x": -3, "y": -2.25 } - ] - }, - "right upper leg": { - "rotate": [ - { "time": 0, "angle": 42.45 }, - { "time": 0.1333, "angle": 52.1 }, - { "time": 0.2666, "angle": 5.96 }, - { "time": 0.5333, "angle": -16.93 }, - { "time": 0.6666, "angle": 1.89 }, - { - "time": 0.8, - "angle": 28.06, - "curve": [ 0.462, 0.11, 1, 1 ] - }, - { - "time": 0.9333, - "angle": 58.68, - "curve": [ 0.5, 0.02, 1, 1 ] - }, - { "time": 1.0666, "angle": 42.45 } - ], - "translate": [ - { "time": 0, "x": 8.11, "y": -2.36 }, - { "time": 0.1333, "x": 10.03, "y": -2.56 }, - { "time": 0.4, "x": 2.76, "y": -2.97 }, - { "time": 0.5333, "x": 2.76, "y": -2.81 }, - { "time": 0.9333, "x": 8.67, "y": -2.54 }, - { "time": 1.0666, "x": 8.11, "y": -2.36 } - ] - }, - "left lower leg": { - "rotate": [ - { "time": 0, "angle": -10.21 }, - { "time": 0.1333, "angle": -55.64 }, - { "time": 0.2666, "angle": -68.12 }, - { "time": 0.5333, "angle": 5.11 }, - { "time": 0.6666, "angle": -28.29 }, - { "time": 0.8, "angle": 4.08 }, - { "time": 0.9333, "angle": 3.53 }, - { "time": 1.0666, "angle": -10.21 } - ] - }, - "left foot": { - "rotate": [ - { "time": 0, "angle": -3.69 }, - { "time": 0.1333, "angle": -10.42 }, - { "time": 0.2666, "angle": -17.14 }, - { "time": 0.4, "angle": -2.83 }, - { "time": 0.5333, "angle": -3.87 }, - { "time": 0.6666, "angle": 2.78 }, - { "time": 0.8, "angle": 1.68 }, - { "time": 0.9333, "angle": -8.54 }, - { "time": 1.0666, "angle": -3.69 } - ] - }, - "right shoulder": { - "rotate": [ - { - "time": 0, - "angle": 20.89, - "curve": [ 0.264, 0, 0.75, 1 ] - }, - { - "time": 0.1333, - "angle": 3.72, - "curve": [ 0.272, 0, 0.841, 1 ] - }, - { "time": 0.6666, "angle": -278.28 }, - { "time": 1.0666, "angle": 20.89 } - ], - "translate": [ - { "time": 0, "x": -7.84, "y": 7.19 }, - { "time": 0.1333, "x": -6.36, "y": 6.42 }, - { "time": 0.6666, "x": -11.07, "y": 5.25 }, - { "time": 1.0666, "x": -7.84, "y": 7.19 } - ] - }, - "right arm": { - "rotate": [ - { - "time": 0, - "angle": -4.02, - "curve": [ 0.267, 0, 0.804, 0.99 ] - }, - { - "time": 0.1333, - "angle": -13.99, - "curve": [ 0.341, 0, 1, 1 ] - }, - { - "time": 0.6666, - "angle": 36.54, - "curve": [ 0.307, 0, 0.787, 0.99 ] - }, - { "time": 1.0666, "angle": -4.02 } - ] - }, - "right hand": { - "rotate": [ - { "time": 0, "angle": 22.92 }, - { "time": 0.4, "angle": -8.97 }, - { "time": 0.6666, "angle": 0.51 }, - { "time": 1.0666, "angle": 22.92 } - ] - }, - "left shoulder": { - "rotate": [ - { "time": 0, "angle": -1.47 }, - { "time": 0.1333, "angle": 13.6 }, - { "time": 0.6666, "angle": 280.74 }, - { "time": 1.0666, "angle": -1.47 } - ], - "translate": [ - { "time": 0, "x": -1.76, "y": 0.56 }, - { "time": 0.6666, "x": -2.47, "y": 8.14 }, - { "time": 1.0666, "x": -1.76, "y": 0.56 } - ] - }, - "left hand": { - "rotate": [ - { - "time": 0, - "angle": 11.58, - "curve": [ 0.169, 0.37, 0.632, 1.55 ] - }, - { - "time": 0.1333, - "angle": 28.13, - "curve": [ 0.692, 0, 0.692, 0.99 ] - }, - { - "time": 0.6666, - "angle": -27.42, - "curve": [ 0.117, 0.41, 0.738, 1.76 ] - }, - { "time": 0.8, "angle": -36.32 }, - { "time": 1.0666, "angle": 11.58 } - ] - }, - "left arm": { - "rotate": [ - { "time": 0, "angle": -8.27 }, - { "time": 0.1333, "angle": 18.43 }, - { "time": 0.6666, "angle": 0.88 }, - { "time": 1.0666, "angle": -8.27 } - ] - }, - "torso": { - "rotate": [ - { "time": 0, "angle": -10.28 }, - { - "time": 0.1333, - "angle": -15.38, - "curve": [ 0.545, 0, 1, 1 ] - }, - { - "time": 0.4, - "angle": -9.78, - "curve": [ 0.58, 0.17, 1, 1 ] - }, - { "time": 0.6666, "angle": -15.75 }, - { "time": 0.9333, "angle": -7.06 }, - { "time": 1.0666, "angle": -10.28 } - ], - "translate": [ - { "time": 0, "x": -3.67, "y": 1.68 }, - { "time": 0.1333, "x": -3.67, "y": 0.68 }, - { "time": 0.4, "x": -3.67, "y": 1.97 }, - { "time": 0.6666, "x": -3.67, "y": -0.14 }, - { "time": 1.0666, "x": -3.67, "y": 1.68 } - ] - }, - "right foot": { - "rotate": [ - { "time": 0, "angle": -5.25 }, - { "time": 0.2666, "angle": -4.08 }, - { "time": 0.4, "angle": -6.45 }, - { "time": 0.5333, "angle": -5.39 }, - { "time": 0.8, "angle": -11.68 }, - { "time": 0.9333, "angle": 0.46 }, - { "time": 1.0666, "angle": -5.25 } - ] - }, - "right lower leg": { - "rotate": [ - { "time": 0, "angle": -3.39 }, - { "time": 0.1333, "angle": -45.53 }, - { "time": 0.2666, "angle": -2.59 }, - { "time": 0.5333, "angle": -19.53 }, - { "time": 0.6666, "angle": -64.8 }, - { - "time": 0.8, - "angle": -82.56, - "curve": [ 0.557, 0.18, 1, 1 ] - }, - { "time": 1.0666, "angle": -3.39 } - ] - }, - "hip": { - "rotate": [ - { "time": 0, "angle": 0, "curve": "stepped" }, - { "time": 1.0666, "angle": 0 } - ], - "translate": [ - { "time": 0, "x": 0, "y": 0 }, - { - "time": 0.1333, - "x": 0, - "y": -7.61, - "curve": [ 0.272, 0.86, 1, 1 ] - }, - { "time": 0.4, "x": 0, "y": 8.7 }, - { "time": 0.5333, "x": 0, "y": -0.41 }, - { - "time": 0.6666, - "x": 0, - "y": -7.05, - "curve": [ 0.235, 0.89, 1, 1 ] - }, - { "time": 0.8, "x": 0, "y": 2.92 }, - { "time": 0.9333, "x": 0, "y": 6.78 }, - { "time": 1.0666, "x": 0, "y": 0 } - ] - }, - "neck": { - "rotate": [ - { "time": 0, "angle": 3.6 }, - { "time": 0.1333, "angle": 17.49 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, - { "time": 0.5333, "angle": 5.17 }, - { "time": 0.6666, "angle": 18.36 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } - ] - }, "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 } + ], + "translate": [ { "time": 0, - "angle": 3.6, - "curve": [ 0, 0, 0.704, 1.61 ] + "x": 0, + "y": 0, + "curve": [ 0.19, 0.4, 0.586, 0.75 ] }, - { "time": 0.1666, "angle": -0.2 }, - { "time": 0.2666, "angle": 6.1 }, - { "time": 0.4, "angle": 3.45 }, { - "time": 0.5333, - "angle": 5.17, - "curve": [ 0, 0, 0.704, 1.61 ] + "time": 0.2758, + "x": 57.88, + "y": -35.72, + "curve": [ 0.39, 0.54, 0.632, 0.72 ] }, - { "time": 0.7, "angle": 1.1 }, - { "time": 0.8, "angle": 6.09 }, - { "time": 0.9333, "angle": 2.28 }, - { "time": 1.0666, "angle": 3.6 } + { + "time": 0.4827, + "x": 87.26, + "y": -87.89, + "curve": [ 0.325, 0.23, 0.587, 0.36 ] + }, + { + "time": 0.6896, + "x": 28.89, + "y": -114.62, + "curve": [ 0.383, 0.23, 0.736, 0.55 ] + }, + { + "time": 0.8965, + "x": -76.58, + "y": -124.98, + "curve": [ 0.129, 0.21, 0.547, 0.64 ] + }, + { + "time": 1.1034, + "x": -154.37, + "y": -77.13, + "curve": [ 0.354, 0.48, 0.729, 0.9 ] + }, + { + "time": 1.3103, + "x": -181.02, + "y": 18.56, + "curve": [ 0.063, 0.15, 0.52, 0.62 ] + }, + { + "time": 1.5862, + "x": -150.38, + "y": 128.67, + "curve": [ 0.381, 0.54, 0.778, 1 ] + }, + { + "time": 1.7931, + "x": -112.08, + "y": 146.28, + "curve": [ 0.242, 0, 0.626, 0.45 ] + }, + { + "time": 1.931, + "x": -63.7, + "y": 111.22, + "curve": [ 0.398, 0.35, 0.786, 0.76 ] + }, + { + "time": 2.1379, + "x": -48.94, + "y": -1.55, + "curve": [ 0.188, 0.21, 0.575, 0.61 ] + }, + { + "time": 2.3448, + "x": -91.69, + "y": -91.93, + "curve": [ 0.362, 0.51, 0.766, 1 ] + }, + { + "time": 2.6206, + "x": -142.79, + "y": -126.83, + "curve": [ 0.227, 0.34, 0.593, 0.75 ] + }, + { + "time": 2.7586, + "x": -176.7, + "y": -98.32, + "curve": [ 0.26, 0.4, 0.612, 0.71 ] + }, + { + "time": 2.8965, + "x": -163.95, + "y": -24.04, + "curve": [ 0.338, 0.37, 0.676, 0.71 ] + }, + { + "time": 2.9655, + "x": -150.17, + "y": 10.71, + "curve": [ 0.387, 0.61, 0.741, 1 ] + }, + { + "time": 3.1034, + "x": -102.44, + "y": 45.92, + "curve": [ 0.31, 0.24, 0.648, 0.58 ] + }, + { + "time": 3.2413, + "x": -53.99, + "y": 70.39, + "curve": [ 0.325, 0.29, 0.663, 0.63 ] + }, + { + "time": 3.3793, + "x": 1.88, + "y": 55.54, + "curve": [ 0.387, 0.33, 0.769, 0.73 ] + }, + { + "time": 3.5862, + "x": 34.26, + "y": 36.13, + "curve": [ 0.206, 0.28, 0.596, 0.67 ] + }, + { + "time": 3.7931, + "x": 23.94, + "y": 1.01, + "curve": [ 0.373, 0.56, 0.759, 1 ] + }, + { "time": 4, "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 } ] } - } + }, + "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, + "offsets": [ + { "slot": "head", "offset": -12 }, + { "slot": "eyes", "offset": -12 } + ] + }, + { + "time": 1.7931, + "offsets": [ + { "slot": "head", "offset": 3 }, + { "slot": "eyes", "offset": 3 } + ] + }, + { + "time": 2.6206, + "offsets": [ + { "slot": "head", "offset": -12 }, + { "slot": "eyes", "offset": -12 } + ] + }, + { "time": 3.5862 } + ] }, "jump": { "bones": { @@ -782,6 +719,284 @@ ] } } + }, + "walk": { + "bones": { + "left upper leg": { + "rotate": [ + { "time": 0, "angle": -26.55 }, + { "time": 0.1333, "angle": -8.78 }, + { "time": 0.2666, "angle": 9.51 }, + { "time": 0.4, "angle": 30.74 }, + { "time": 0.5333, "angle": 25.33 }, + { "time": 0.6666, "angle": 26.11 }, + { "time": 0.8, "angle": -7.7 }, + { "time": 0.9333, "angle": -21.19 }, + { "time": 1.0666, "angle": -26.55 } + ], + "translate": [ + { "time": 0, "x": -3, "y": -2.25 }, + { "time": 0.4, "x": -2.18, "y": -2.25 }, + { "time": 1.0666, "x": -3, "y": -2.25 } + ] + }, + "right upper leg": { + "rotate": [ + { "time": 0, "angle": 42.45 }, + { "time": 0.1333, "angle": 52.1 }, + { "time": 0.2666, "angle": 5.96 }, + { "time": 0.5333, "angle": -16.93 }, + { "time": 0.6666, "angle": 1.89 }, + { + "time": 0.8, + "angle": 28.06, + "curve": [ 0.462, 0.11, 1, 1 ] + }, + { + "time": 0.9333, + "angle": 58.68, + "curve": [ 0.5, 0.02, 1, 1 ] + }, + { "time": 1.0666, "angle": 42.45 } + ], + "translate": [ + { "time": 0, "x": 8.11, "y": -2.36 }, + { "time": 0.1333, "x": 10.03, "y": -2.56 }, + { "time": 0.4, "x": 2.76, "y": -2.97 }, + { "time": 0.5333, "x": 2.76, "y": -2.81 }, + { "time": 0.9333, "x": 8.67, "y": -2.54 }, + { "time": 1.0666, "x": 8.11, "y": -2.36 } + ] + }, + "left lower leg": { + "rotate": [ + { "time": 0, "angle": -10.21 }, + { "time": 0.1333, "angle": -55.64 }, + { "time": 0.2666, "angle": -68.12 }, + { "time": 0.5333, "angle": 5.11 }, + { "time": 0.6666, "angle": -28.29 }, + { "time": 0.8, "angle": 4.08 }, + { "time": 0.9333, "angle": 3.53 }, + { "time": 1.0666, "angle": -10.21 } + ] + }, + "left foot": { + "rotate": [ + { "time": 0, "angle": -3.69 }, + { "time": 0.1333, "angle": -10.42 }, + { "time": 0.2666, "angle": -17.14 }, + { "time": 0.4, "angle": -2.83 }, + { "time": 0.5333, "angle": -3.87 }, + { "time": 0.6666, "angle": 2.78 }, + { "time": 0.8, "angle": 1.68 }, + { "time": 0.9333, "angle": -8.54 }, + { "time": 1.0666, "angle": -3.69 } + ] + }, + "right shoulder": { + "rotate": [ + { + "time": 0, + "angle": 20.89, + "curve": [ 0.264, 0, 0.75, 1 ] + }, + { + "time": 0.1333, + "angle": 3.72, + "curve": [ 0.272, 0, 0.841, 1 ] + }, + { "time": 0.6666, "angle": -278.28 }, + { "time": 1.0666, "angle": 20.89 } + ], + "translate": [ + { "time": 0, "x": -7.84, "y": 7.19 }, + { "time": 0.1333, "x": -6.36, "y": 6.42 }, + { "time": 0.6666, "x": -11.07, "y": 5.25 }, + { "time": 1.0666, "x": -7.84, "y": 7.19 } + ] + }, + "right arm": { + "rotate": [ + { + "time": 0, + "angle": -4.02, + "curve": [ 0.267, 0, 0.804, 0.99 ] + }, + { + "time": 0.1333, + "angle": -13.99, + "curve": [ 0.341, 0, 1, 1 ] + }, + { + "time": 0.6666, + "angle": 36.54, + "curve": [ 0.307, 0, 0.787, 0.99 ] + }, + { "time": 1.0666, "angle": -4.02 } + ] + }, + "right hand": { + "rotate": [ + { "time": 0, "angle": 22.92 }, + { "time": 0.4, "angle": -8.97 }, + { "time": 0.6666, "angle": 0.51 }, + { "time": 1.0666, "angle": 22.92 } + ] + }, + "left shoulder": { + "rotate": [ + { "time": 0, "angle": -1.47 }, + { "time": 0.1333, "angle": 13.6 }, + { "time": 0.6666, "angle": 280.74 }, + { "time": 1.0666, "angle": -1.47 } + ], + "translate": [ + { "time": 0, "x": -1.76, "y": 0.56 }, + { "time": 0.6666, "x": -2.47, "y": 8.14 }, + { "time": 1.0666, "x": -1.76, "y": 0.56 } + ] + }, + "left hand": { + "rotate": [ + { + "time": 0, + "angle": 11.58, + "curve": [ 0.169, 0.37, 0.632, 1.55 ] + }, + { + "time": 0.1333, + "angle": 28.13, + "curve": [ 0.692, 0, 0.692, 0.99 ] + }, + { + "time": 0.6666, + "angle": -27.42, + "curve": [ 0.117, 0.41, 0.738, 1.76 ] + }, + { "time": 0.8, "angle": -36.32 }, + { "time": 1.0666, "angle": 11.58 } + ] + }, + "left arm": { + "rotate": [ + { "time": 0, "angle": -8.27 }, + { "time": 0.1333, "angle": 18.43 }, + { "time": 0.6666, "angle": 0.88 }, + { "time": 1.0666, "angle": -8.27 } + ] + }, + "torso": { + "rotate": [ + { "time": 0, "angle": -10.28 }, + { + "time": 0.1333, + "angle": -15.38, + "curve": [ 0.545, 0, 1, 1 ] + }, + { + "time": 0.4, + "angle": -9.78, + "curve": [ 0.58, 0.17, 1, 1 ] + }, + { "time": 0.6666, "angle": -15.75 }, + { "time": 0.9333, "angle": -7.06 }, + { "time": 1.0666, "angle": -10.28 } + ], + "translate": [ + { "time": 0, "x": -3.67, "y": 1.68 }, + { "time": 0.1333, "x": -3.67, "y": 0.68 }, + { "time": 0.4, "x": -3.67, "y": 1.97 }, + { "time": 0.6666, "x": -3.67, "y": -0.14 }, + { "time": 1.0666, "x": -3.67, "y": 1.68 } + ] + }, + "right foot": { + "rotate": [ + { "time": 0, "angle": -5.25 }, + { "time": 0.2666, "angle": -4.08 }, + { "time": 0.4, "angle": -6.45 }, + { "time": 0.5333, "angle": -5.39 }, + { "time": 0.8, "angle": -11.68 }, + { "time": 0.9333, "angle": 0.46 }, + { "time": 1.0666, "angle": -5.25 } + ] + }, + "right lower leg": { + "rotate": [ + { "time": 0, "angle": -3.39 }, + { "time": 0.1333, "angle": -45.53 }, + { "time": 0.2666, "angle": -2.59 }, + { "time": 0.5333, "angle": -19.53 }, + { "time": 0.6666, "angle": -64.8 }, + { + "time": 0.8, + "angle": -82.56, + "curve": [ 0.557, 0.18, 1, 1 ] + }, + { "time": 1.0666, "angle": -3.39 } + ] + }, + "hip": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 1.0666, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0 }, + { + "time": 0.1333, + "x": 0, + "y": -7.61, + "curve": [ 0.272, 0.86, 1, 1 ] + }, + { "time": 0.4, "x": 0, "y": 8.7 }, + { "time": 0.5333, "x": 0, "y": -0.41 }, + { + "time": 0.6666, + "x": 0, + "y": -7.05, + "curve": [ 0.235, 0.89, 1, 1 ] + }, + { "time": 0.8, "x": 0, "y": 2.92 }, + { "time": 0.9333, "x": 0, "y": 6.78 }, + { "time": 1.0666, "x": 0, "y": 0 } + ] + }, + "neck": { + "rotate": [ + { "time": 0, "angle": 3.6 }, + { "time": 0.1333, "angle": 17.49 }, + { "time": 0.2666, "angle": 6.1 }, + { "time": 0.4, "angle": 3.45 }, + { "time": 0.5333, "angle": 5.17 }, + { "time": 0.6666, "angle": 18.36 }, + { "time": 0.8, "angle": 6.09 }, + { "time": 0.9333, "angle": 2.28 }, + { "time": 1.0666, "angle": 3.6 } + ] + }, + "head": { + "rotate": [ + { + "time": 0, + "angle": 3.6, + "curve": [ 0, 0, 0.704, 1.61 ] + }, + { "time": 0.1666, "angle": -0.2 }, + { "time": 0.2666, "angle": 6.1 }, + { "time": 0.4, "angle": 3.45 }, + { + "time": 0.5333, + "angle": 5.17, + "curve": [ 0, 0, 0.704, 1.61 ] + }, + { "time": 0.7, "angle": 1.1 }, + { "time": 0.8, "angle": 6.09 }, + { "time": 0.9333, "angle": 2.28 }, + { "time": 1.0666, "angle": 3.6 } + ] + } + } } } } \ No newline at end of file diff --git a/spine-corona/main.lua b/spine-corona/main.lua index 6ee9ebb8f..97c53f307 100644 --- a/spine-corona/main.lua +++ b/spine-corona/main.lua @@ -1,49 +1,4 @@ -local spine = require "spine-corona.spine" - ---local name = "goblins" -local name = "spineboy" - -local json = spine.SkeletonJson.new() -json.scale = 1 -local skeletonData = json:readSkeletonDataFile("data/" .. name .. "/" .. name .. ".json") -local walkAnimation = skeletonData:findAnimation("walk") - -local skeleton = spine.Skeleton.new(skeletonData) -function skeleton:createImage (attachment) - -- Customize where images are loaded. - return display.newImage("data/" .. name .. "/" .. attachment.name .. ".png") -end -skeleton.group.x = 150 -skeleton.group.y = 325 -skeleton.flipX = false -skeleton.flipY = false -skeleton.debug = true -- Omit or set to false to not draw debug lines on top of the images. -if name == "goblins" then skeleton:setSkin("goblingirl") end -skeleton:setToSetupPose() - --- AnimationStateData defines crossfade durations between animations. -local stateData = spine.AnimationStateData.new(skeletonData) -stateData:setMix("walk", "jump", 0.2) -stateData:setMix("jump", "walk", 0.4) - --- AnimationState has a queue of animations and can apply them with crossfading. -local state = spine.AnimationState.new(stateData) -state:setAnimation("walk", false) -state:addAnimation("jump", false) -state:addAnimation("walk", true) - -local lastTime = 0 -local animationTime = 0 -Runtime:addEventListener("enterFrame", function (event) - -- Compute time in seconds since last frame. - local currentTime = event.time / 1000 - local delta = currentTime - lastTime - lastTime = currentTime - - -- Update the state with the delta time, apply it, and update the world transforms. - state:update(delta) - state:apply(skeleton) - skeleton:updateWorldTransform() -end) - +-- require "examples.spineboy" +-- require "examples.goblins" +require "examples.dragon"