├── .gitignore ├── .prettierrc ├── .vscode └── settings.json ├── README.md ├── assets-raw └── goblins │ ├── goblins.spine │ └── images │ ├── dagger.png │ ├── goblin │ ├── eyes-closed.png │ ├── head.png │ ├── left-arm.png │ ├── left-foot.png │ ├── left-hand.png │ ├── left-lower-leg.png │ ├── left-shoulder.png │ ├── left-upper-leg.png │ ├── neck.png │ ├── pelvis.png │ ├── right-arm.png │ ├── right-foot.png │ ├── right-hand.png │ ├── right-lower-leg.png │ ├── right-shoulder.png │ ├── right-upper-leg.png │ ├── torso.png │ ├── undie-straps.png │ └── undies.png │ ├── goblingirl │ ├── eyes-closed.png │ ├── head.png │ ├── left-arm.png │ ├── left-foot.png │ ├── left-hand.png │ ├── left-lower-leg.png │ ├── left-shoulder.png │ ├── left-upper-leg.png │ ├── neck.png │ ├── pelvis.png │ ├── right-arm.png │ ├── right-foot.png │ ├── right-hand.png │ ├── right-lower-leg.png │ ├── right-shoulder.png │ ├── right-upper-leg.png │ ├── torso.png │ ├── undie-straps.png │ └── undies.png │ ├── pack.json │ └── spear.png ├── btn ├── animation.png ├── attachment.png └── skin.png ├── index.html ├── js ├── button.js ├── game.js └── mainScene.js ├── libs ├── SpinePlugin.min.js └── phaser.min.js ├── package.json ├── screenshots └── screenshot.png └── spine ├── goblins.atlas ├── goblins.json └── goblins.png /.gitignore: -------------------------------------------------------------------------------- 1 | /**/*Zone.Identifier -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.enabled": true 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
31 | Find the source code on 32 | github. 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /js/button.js: -------------------------------------------------------------------------------- 1 | const button = (scene, x, y, texture, cb) => { 2 | scene.add 3 | .image(x, y, texture) 4 | .setInteractive() 5 | .on('pointerdown', () => { 6 | cb() 7 | }) 8 | } 9 | 10 | export default button 11 | -------------------------------------------------------------------------------- /js/game.js: -------------------------------------------------------------------------------- 1 | import MainScene from './mainScene.js' 2 | 3 | const config = { 4 | type: Phaser.WEBGL, 5 | backgroundColor: '#cdcdcd', 6 | scale: { 7 | mode: Phaser.Scale.FIT, 8 | autoCenter: Phaser.DOM.CENTER_BOTH, 9 | width: 800, 10 | height: 600, 11 | parent: 'phaser-example' 12 | }, 13 | plugins: { 14 | scene: [ 15 | { 16 | key: 'SpinePlugin', 17 | plugin: window.SpinePlugin, 18 | sceneKey: 'spine' 19 | } 20 | ] 21 | }, 22 | scene: [MainScene] 23 | } 24 | 25 | window.addEventListener('load', () => { 26 | new Phaser.Game(config) 27 | }) 28 | -------------------------------------------------------------------------------- /js/mainScene.js: -------------------------------------------------------------------------------- 1 | import button from './button.js' 2 | 3 | var goblin 4 | let skins = ['goblin', 'goblingirl'] 5 | let attachments = ['spear', 'dagger', null] 6 | let animations = ['walk', 'idle'] 7 | 8 | class MainScene extends Phaser.Scene { 9 | constructor() { 10 | super({ key: 'MainScene' }) 11 | } 12 | 13 | preload() { 14 | this.load.image('skin', 'btn/skin.png') 15 | this.load.image('animation', 'btn/animation.png') 16 | this.load.image('attachment', 'btn/attachment.png') 17 | 18 | this.load.setPath('spine/') 19 | this.load.spine('goblin', 'goblins.json', 'goblins.atlas') 20 | } 21 | 22 | create() { 23 | const getAttachments = () => { 24 | return goblin.skeleton.skin.attachments 25 | } 26 | 27 | const getSlots = () => { 28 | return goblin.skeleton.slots 29 | } 30 | 31 | const setAttachment = (slotName, attachmentName) => { 32 | goblin.skeleton.setAttachment(slotName, attachmentName) 33 | } 34 | 35 | const setSkin = skinName => { 36 | goblin.setSkin(null) 37 | goblin.setSkinByName(skinName) 38 | } 39 | 40 | const setAnimation = (animation, loop = false) => { 41 | goblin.play(animation, loop) 42 | } 43 | 44 | // add buttons 45 | button(this, 120, 50, 'skin', () => { 46 | let index = (goblin.customParams.skin += 1) 47 | let skin = skins[index % skins.length] 48 | setSkin(skin) 49 | }) 50 | button(this, 360, 50, 'animation', () => { 51 | let index = (goblin.customParams.animation += 1) 52 | let animation = animations[index % animations.length] 53 | setAnimation(animation, true) 54 | }) 55 | button(this, 600, 50, 'attachment', () => { 56 | let index = (goblin.customParams.attachment += 1) 57 | let slot = 'left hand item' 58 | let attachment = attachments[index % attachments.length] 59 | setAttachment(slot, attachment) 60 | }) 61 | 62 | // add the goblin 63 | goblin = this.add.spine(400, 600, 'goblin', 'walk', true) 64 | goblin.customParams = { 65 | skin: 0, 66 | animation: 0, 67 | attachment: 0 68 | } 69 | setSkin('goblin') 70 | goblin.setMix('walk', 'idle', 0.3) 71 | goblin.setMix('idle', 'walk', 0.3) 72 | 73 | // remove dagger in right hand 74 | setAttachment('right hand item', null) 75 | 76 | console.log('Attachments: ', getAttachments()) 77 | console.log('Slots: ', getSlots()) 78 | } 79 | } 80 | 81 | export default MainScene 82 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phaser3-spine-example", 3 | "version": "3.21.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/yandeu/phaser3-spine-example.git" 12 | }, 13 | "keywords": [], 14 | "author": "Yannick Deubel", 15 | "license": "MIT", 16 | "bugs": { 17 | "url": "https://github.com/yandeu/phaser3-spine-example/issues" 18 | }, 19 | "homepage": "https://github.com/yandeu/phaser3-spine-example#readme" 20 | } 21 | -------------------------------------------------------------------------------- /screenshots/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandeu/phaser3-spine-example/585357610fa3f18979faa66abb60429008f6120e/screenshots/screenshot.png -------------------------------------------------------------------------------- /spine/goblins.atlas: -------------------------------------------------------------------------------- 1 | 2 | goblins.png 3 | size: 400,269 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | dagger 8 | rotate: true 9 | xy: 176, 217 10 | size: 26, 108 11 | orig: 26, 108 12 | offset: 0, 0 13 | index: -1 14 | goblin/eyes-closed 15 | rotate: true 16 | xy: 358, 209 17 | size: 34, 11 18 | orig: 34, 12 19 | offset: 0, 1 20 | index: -1 21 | goblin/head 22 | rotate: false 23 | xy: 2, 99 24 | size: 103, 63 25 | orig: 103, 66 26 | offset: 0, 1 27 | index: -1 28 | goblin/left-arm 29 | rotate: true 30 | xy: 249, 178 31 | size: 37, 35 32 | orig: 37, 35 33 | offset: 0, 0 34 | index: -1 35 | goblin/left-foot 36 | rotate: true 37 | xy: 143, 2 38 | size: 63, 29 39 | orig: 65, 31 40 | offset: 2, 1 41 | index: -1 42 | goblin/left-hand 43 | rotate: true 44 | xy: 246, 140 45 | size: 36, 41 46 | orig: 36, 41 47 | offset: 0, 0 48 | index: -1 49 | goblin/left-lower-leg 50 | rotate: false 51 | xy: 371, 197 52 | size: 27, 70 53 | orig: 33, 70 54 | offset: 3, 0 55 | index: -1 56 | goblin/left-shoulder 57 | rotate: false 58 | xy: 319, 95 59 | size: 29, 43 60 | orig: 29, 44 61 | offset: 0, 1 62 | index: -1 63 | goblin/left-upper-leg 64 | rotate: true 65 | xy: 176, 182 66 | size: 33, 71 67 | orig: 33, 73 68 | offset: 0, 2 69 | index: -1 70 | goblin/neck 71 | rotate: false 72 | xy: 282, 98 73 | size: 35, 40 74 | orig: 36, 41 75 | offset: 0, 0 76 | index: -1 77 | goblin/pelvis 78 | rotate: false 79 | xy: 144, 102 80 | size: 59, 43 81 | orig: 62, 43 82 | offset: 2, 0 83 | index: -1 84 | goblin/right-arm 85 | rotate: false 86 | xy: 292, 47 87 | size: 21, 49 88 | orig: 23, 50 89 | offset: 1, 0 90 | index: -1 91 | goblin/right-foot 92 | rotate: false 93 | xy: 144, 67 94 | size: 59, 33 95 | orig: 63, 33 96 | offset: 0, 0 97 | index: -1 98 | goblin/right-hand 99 | rotate: true 100 | xy: 291, 2 101 | size: 36, 37 102 | orig: 36, 37 103 | offset: 0, 0 104 | index: -1 105 | goblin/right-lower-leg 106 | rotate: false 107 | xy: 70, 22 108 | size: 35, 75 109 | orig: 36, 76 110 | offset: 1, 1 111 | index: -1 112 | goblin/right-shoulder 113 | rotate: true 114 | xy: 289, 140 115 | size: 39, 42 116 | orig: 39, 45 117 | offset: 0, 0 118 | index: -1 119 | goblin/right-upper-leg 120 | rotate: false 121 | xy: 205, 82 122 | size: 34, 63 123 | orig: 34, 63 124 | offset: 0, 0 125 | index: -1 126 | goblin/torso 127 | rotate: false 128 | xy: 107, 147 129 | size: 67, 96 130 | orig: 68, 96 131 | offset: 0, 0 132 | index: -1 133 | goblin/undie-straps 134 | rotate: true 135 | xy: 250, 39 136 | size: 55, 19 137 | orig: 55, 19 138 | offset: 0, 0 139 | index: -1 140 | goblin/undies 141 | rotate: true 142 | xy: 370, 159 143 | size: 36, 27 144 | orig: 36, 29 145 | offset: 0, 0 146 | index: -1 147 | goblingirl/eyes-closed 148 | rotate: false 149 | xy: 205, 5 150 | size: 37, 15 151 | orig: 37, 21 152 | offset: 0, 0 153 | index: -1 154 | goblingirl/head 155 | rotate: false 156 | xy: 2, 164 157 | size: 103, 79 158 | orig: 103, 81 159 | offset: 0, 2 160 | index: -1 161 | goblingirl/left-arm 162 | rotate: true 163 | xy: 333, 142 164 | size: 37, 35 165 | orig: 37, 35 166 | offset: 0, 0 167 | index: -1 168 | goblingirl/left-foot 169 | rotate: true 170 | xy: 174, 2 171 | size: 63, 29 172 | orig: 65, 31 173 | offset: 2, 1 174 | index: -1 175 | goblingirl/left-hand 176 | rotate: true 177 | xy: 250, 2 178 | size: 35, 39 179 | orig: 35, 40 180 | offset: 0, 1 181 | index: -1 182 | goblingirl/left-lower-leg 183 | rotate: true 184 | xy: 286, 216 185 | size: 27, 70 186 | orig: 33, 70 187 | offset: 3, 0 188 | index: -1 189 | goblingirl/left-shoulder 190 | rotate: false 191 | xy: 349, 45 192 | size: 27, 44 193 | orig: 28, 46 194 | offset: 0, 2 195 | index: -1 196 | goblingirl/left-upper-leg 197 | rotate: true 198 | xy: 176, 147 199 | size: 33, 68 200 | orig: 33, 70 201 | offset: 0, 2 202 | index: -1 203 | goblingirl/neck 204 | rotate: false 205 | xy: 315, 52 206 | size: 32, 41 207 | orig: 35, 41 208 | offset: 0, 0 209 | index: -1 210 | goblingirl/pelvis 211 | rotate: true 212 | xy: 205, 22 213 | size: 58, 43 214 | orig: 62, 43 215 | offset: 2, 0 216 | index: -1 217 | goblingirl/right-arm 218 | rotate: false 219 | xy: 350, 91 220 | size: 21, 49 221 | orig: 28, 50 222 | offset: 4, 0 223 | index: -1 224 | goblingirl/right-foot 225 | rotate: false 226 | xy: 286, 181 227 | size: 59, 33 228 | orig: 63, 33 229 | offset: 0, 0 230 | index: -1 231 | goblingirl/right-hand 232 | rotate: false 233 | xy: 330, 6 234 | size: 34, 37 235 | orig: 36, 37 236 | offset: 1, 0 237 | index: -1 238 | goblingirl/right-lower-leg 239 | rotate: false 240 | xy: 107, 70 241 | size: 35, 75 242 | orig: 36, 76 243 | offset: 1, 1 244 | index: -1 245 | goblingirl/right-shoulder 246 | rotate: false 247 | xy: 241, 96 248 | size: 39, 42 249 | orig: 39, 45 250 | offset: 0, 0 251 | index: -1 252 | goblingirl/right-upper-leg 253 | rotate: false 254 | xy: 107, 5 255 | size: 34, 63 256 | orig: 34, 63 257 | offset: 0, 0 258 | index: -1 259 | goblingirl/torso 260 | rotate: false 261 | xy: 2, 2 262 | size: 66, 95 263 | orig: 68, 96 264 | offset: 0, 1 265 | index: -1 266 | goblingirl/undie-straps 267 | rotate: true 268 | xy: 271, 40 269 | size: 54, 19 270 | orig: 55, 19 271 | offset: 1, 0 272 | index: -1 273 | goblingirl/undies 274 | rotate: true 275 | xy: 366, 8 276 | size: 35, 27 277 | orig: 36, 29 278 | offset: 1, 0 279 | index: -1 280 | spear 281 | rotate: true 282 | xy: 2, 245 283 | size: 22, 367 284 | orig: 22, 368 285 | offset: 0, 1 286 | index: -1 287 | -------------------------------------------------------------------------------- /spine/goblins.json: -------------------------------------------------------------------------------- 1 | { 2 | "skeleton": { 3 | "hash": "5qvIWTOr4qJ3EInzY3PtbTRvj/I", 4 | "spine": "3.8.78", 5 | "x": -135.67, 6 | "y": -5.3, 7 | "width": 277.16, 8 | "height": 354.91, 9 | "images": "./images/", 10 | "audio": "" 11 | }, 12 | "bones": [ 13 | { "name": "root" }, 14 | { "name": "hip", "parent": "root", "x": 0.65, "y": 114.41 }, 15 | { "name": "left upper leg", "parent": "hip", "length": 50.4, "rotation": -89.1, "x": 14.45, "y": 2.81 }, 16 | { "name": "left lower leg", "parent": "left upper leg", "length": 49.9, "rotation": -16.66, "x": 56.34, "y": 0.99 }, 17 | { "name": "left foot", "parent": "left lower leg", "length": 46.5, "rotation": 102.43, "x": 58.94, "y": -7.61 }, 18 | { "name": "right upper leg", "parent": "hip", "length": 42.46, "rotation": -97.5, "x": -20.08, "y": -6.84 }, 19 | { "name": "right lower leg", "parent": "right upper leg", "length": 58.53, "rotation": -14.34, "x": 43, "y": -0.62 }, 20 | { "name": "right foot", "parent": "right lower leg", "length": 45.46, "rotation": 110.31, "x": 64.89, "y": 0.04 }, 21 | { "name": "torso", "parent": "hip", "length": 85.83, "rotation": 93.93, "x": -6.42, "y": 1.98 }, 22 | { "name": "neck", "parent": "torso", "length": 18.38, "rotation": -1.52, "x": 81.68, "y": -6.35 }, 23 | { "name": "head", "parent": "neck", "length": 68.29, "rotation": -13.92, "x": 20.94, "y": 11.59 }, 24 | { "name": "right shoulder", "parent": "torso", "length": 37.25, "rotation": 133.89, "x": 76.02, "y": 18.15 }, 25 | { "name": "right arm", "parent": "right shoulder", "length": 36.75, "rotation": 36.33, "x": 37.61, "y": 0.31 }, 26 | { "name": "right hand", "parent": "right arm", "length": 15.32, "rotation": 2.36, "x": 36.9, "y": 0.35 }, 27 | { "name": "left shoulder", "parent": "torso", "length": 35.43, "rotation": -156.96, "x": 74.05, "y": -20.39 }, 28 | { "name": "left arm", "parent": "left shoulder", "length": 35.62, "rotation": 28.17, "x": 37.86, "y": -2.35 }, 29 | { "name": "left hand", "parent": "left arm", "length": 11.52, "rotation": 2.7, "x": 35.62, "y": 0.08 }, 30 | { "name": "pelvis", "parent": "hip", "x": 1.41, "y": -6.58 } 31 | ], 32 | "slots": [ 33 | { "name": "left shoulder", "bone": "left shoulder", "attachment": "left shoulder" }, 34 | { "name": "left arm", "bone": "left arm", "attachment": "left arm" }, 35 | { "name": "left hand item", "bone": "left hand", "attachment": "spear" }, 36 | { "name": "left hand", "bone": "left hand", "attachment": "left hand" }, 37 | { "name": "left foot", "bone": "left foot", "attachment": "left foot" }, 38 | { "name": "left lower leg", "bone": "left lower leg", "attachment": "left lower leg" }, 39 | { "name": "left upper leg", "bone": "left upper leg", "attachment": "left upper leg" }, 40 | { "name": "neck", "bone": "neck", "attachment": "neck" }, 41 | { "name": "torso", "bone": "torso", "attachment": "torso" }, 42 | { "name": "pelvis", "bone": "pelvis", "attachment": "pelvis" }, 43 | { "name": "right foot", "bone": "right foot", "attachment": "right foot" }, 44 | { "name": "right lower leg", "bone": "right lower leg", "attachment": "right lower leg" }, 45 | { "name": "undie straps", "bone": "pelvis", "attachment": "undie straps" }, 46 | { "name": "undies", "bone": "pelvis", "attachment": "undies" }, 47 | { "name": "right upper leg", "bone": "right upper leg", "attachment": "right upper leg" }, 48 | { "name": "head", "bone": "head", "attachment": "head" }, 49 | { "name": "eyes", "bone": "head" }, 50 | { "name": "right shoulder", "bone": "right shoulder", "attachment": "right shoulder" }, 51 | { "name": "right arm", "bone": "right arm", "attachment": "right arm" }, 52 | { "name": "right hand item", "bone": "right hand", "attachment": "dagger" }, 53 | { "name": "right hand", "bone": "right hand", "attachment": "right hand" } 54 | ], 55 | "skins": [ 56 | { 57 | "name": "default", 58 | "attachments": { 59 | "left hand item": { 60 | "dagger": { "x": 7.88, "y": -23.46, "rotation": 10.48, "width": 26, "height": 108 }, 61 | "spear": { "x": -4.56, "y": 39.2, "rotation": 13.05, "width": 22, "height": 368 } 62 | }, 63 | "right hand item": { 64 | "dagger": { "x": 7.18, "y": -22.39, "rotation": -5.27, "width": 26, "height": 108 } 65 | } 66 | } 67 | }, 68 | { 69 | "name": "goblin", 70 | "attachments": { 71 | "eyes": { 72 | "eyes closed": { "name": "goblin/eyes-closed", "x": 32.22, "y": -21.27, "rotation": -88.93, "width": 34, "height": 12 } 73 | }, 74 | "head": { 75 | "head": { "name": "goblin/head", "x": 25.74, "y": 2.33, "rotation": -92.29, "width": 103, "height": 66 } 76 | }, 77 | "left arm": { 78 | "left arm": { 79 | "name": "goblin/left-arm", 80 | "x": 16.7, 81 | "y": -1.69, 82 | "scaleX": 1.0573, 83 | "scaleY": 1.0573, 84 | "rotation": 33.85, 85 | "width": 37, 86 | "height": 35 87 | } 88 | }, 89 | "left foot": { 90 | "left foot": { "name": "goblin/left-foot", "x": 24.85, "y": 8.75, "rotation": 3.32, "width": 65, "height": 31 } 91 | }, 92 | "left hand": { 93 | "left hand": { 94 | "name": "goblin/left-hand", 95 | "x": 3.47, 96 | "y": 3.41, 97 | "scaleX": 0.8922, 98 | "scaleY": 0.8922, 99 | "rotation": 31.14, 100 | "width": 36, 101 | "height": 41 102 | } 103 | }, 104 | "left lower leg": { 105 | "left lower leg": { "name": "goblin/left-lower-leg", "x": 23.59, "y": -2.07, "rotation": 105.76, "width": 33, "height": 70 } 106 | }, 107 | "left shoulder": { 108 | "left shoulder": { "name": "goblin/left-shoulder", "x": 15.56, "y": -2.27, "rotation": 62.01, "width": 29, "height": 44 } 109 | }, 110 | "left upper leg": { 111 | "left upper leg": { "name": "goblin/left-upper-leg", "x": 29.69, "y": -3.87, "rotation": 89.1, "width": 33, "height": 73 } 112 | }, 113 | "neck": { 114 | "neck": { "name": "goblin/neck", "x": 10.1, "y": 0.42, "rotation": -93.7, "width": 36, "height": 41 } 115 | }, 116 | "pelvis": { 117 | "pelvis": { "name": "goblin/pelvis", "x": -5.62, "y": 0.77, "width": 62, "height": 43 } 118 | }, 119 | "right arm": { 120 | "right arm": { "name": "goblin/right-arm", "x": 16.44, "y": -1.04, "rotation": 94.32, "width": 23, "height": 50 } 121 | }, 122 | "right foot": { 123 | "right foot": { "name": "goblin/right-foot", "x": 23.57, "y": 9.8, "rotation": 1.53, "width": 63, "height": 33 } 124 | }, 125 | "right hand": { 126 | "right hand": { "name": "goblin/right-hand", "x": 7.89, "y": 2.78, "rotation": 91.96, "width": 36, "height": 37 } 127 | }, 128 | "right lower leg": { 129 | "right lower leg": { "name": "goblin/right-lower-leg", "x": 25.68, "y": -3.16, "rotation": 111.84, "width": 36, "height": 76 } 130 | }, 131 | "right shoulder": { 132 | "right shoulder": { "name": "goblin/right-shoulder", "x": 15.68, "y": -1.03, "rotation": 130.65, "width": 39, "height": 45 } 133 | }, 134 | "right upper leg": { 135 | "right upper leg": { "name": "goblin/right-upper-leg", "x": 20.35, "y": 1.48, "rotation": 97.5, "width": 34, "height": 63 } 136 | }, 137 | "torso": { 138 | "torso": { "name": "goblin/torso", "x": 38.1, "y": -3.87, "rotation": -94.95, "width": 68, "height": 96 } 139 | }, 140 | "undie straps": { 141 | "undie straps": { "name": "goblin/undie-straps", "x": -3.88, "y": 13.11, "scaleX": 1.0896, "width": 55, "height": 19 } 142 | }, 143 | "undies": { 144 | "undies": { "name": "goblin/undies", "x": 6.3, "y": 0.13, "rotation": 0.92, "width": 36, "height": 29 } 145 | } 146 | } 147 | }, 148 | { 149 | "name": "goblingirl", 150 | "attachments": { 151 | "eyes": { 152 | "eyes closed": { "name": "goblingirl/eyes-closed", "x": 28, "y": -25.55, "rotation": -87.05, "width": 37, "height": 21 } 153 | }, 154 | "head": { 155 | "head": { "name": "goblingirl/head", "x": 27.72, "y": -4.32, "rotation": -85.58, "width": 103, "height": 81 } 156 | }, 157 | "left arm": { 158 | "left arm": { "name": "goblingirl/left-arm", "x": 19.64, "y": -2.43, "rotation": 33.05, "width": 37, "height": 35 } 159 | }, 160 | "left foot": { 161 | "left foot": { "name": "goblingirl/left-foot", "x": 25.18, "y": 7.92, "rotation": 3.32, "width": 65, "height": 31 } 162 | }, 163 | "left hand": { 164 | "left hand": { 165 | "name": "goblingirl/left-hand", 166 | "x": 4.34, 167 | "y": 2.39, 168 | "scaleX": 0.8965, 169 | "scaleY": 0.8965, 170 | "rotation": 30.35, 171 | "width": 35, 172 | "height": 40 173 | } 174 | }, 175 | "left lower leg": { 176 | "left lower leg": { "name": "goblingirl/left-lower-leg", "x": 25.02, "y": -0.61, "rotation": 105.76, "width": 33, "height": 70 } 177 | }, 178 | "left shoulder": { 179 | "left shoulder": { "name": "goblingirl/left-shoulder", "x": 19.81, "y": -0.43, "rotation": 61.22, "width": 28, "height": 46 } 180 | }, 181 | "left upper leg": { 182 | "left upper leg": { "name": "goblingirl/left-upper-leg", "x": 30.22, "y": -2.95, "rotation": 89.1, "width": 33, "height": 70 } 183 | }, 184 | "neck": { 185 | "neck": { "name": "goblingirl/neck", "x": 6.16, "y": -3.15, "rotation": -98.86, "width": 35, "height": 41 } 186 | }, 187 | "pelvis": { 188 | "pelvis": { "name": "goblingirl/pelvis", "x": -3.88, "y": 3.19, "width": 62, "height": 43 } 189 | }, 190 | "right arm": { 191 | "right arm": { "name": "goblingirl/right-arm", "x": 16.85, "y": -0.66, "rotation": 93.53, "width": 28, "height": 50 } 192 | }, 193 | "right foot": { 194 | "right foot": { "name": "goblingirl/right-foot", "x": 23.46, "y": 9.66, "rotation": 1.53, "width": 63, "height": 33 } 195 | }, 196 | "right hand": { 197 | "right hand": { "name": "goblingirl/right-hand", "x": 7.22, "y": 3.44, "rotation": 91.17, "width": 36, "height": 37 } 198 | }, 199 | "right lower leg": { 200 | "right lower leg": { "name": "goblingirl/right-lower-leg", "x": 26.15, "y": -3.28, "rotation": 111.84, "width": 36, "height": 76 } 201 | }, 202 | "right shoulder": { 203 | "right shoulder": { "name": "goblingirl/right-shoulder", "x": 14.46, "y": 0.46, "rotation": 129.85, "width": 39, "height": 45 } 204 | }, 205 | "right upper leg": { 206 | "right upper leg": { "name": "goblingirl/right-upper-leg", "x": 19.7, "y": 2.13, "rotation": 97.5, "width": 34, "height": 63 } 207 | }, 208 | "torso": { 209 | "torso": { "name": "goblingirl/torso", "x": 36.28, "y": -5.14, "rotation": -95.75, "width": 68, "height": 96 } 210 | }, 211 | "undie straps": { 212 | "undie straps": { "name": "goblingirl/undie-straps", "x": -1.52, "y": 14.19, "width": 55, "height": 19 } 213 | }, 214 | "undies": { 215 | "undies": { "name": "goblingirl/undies", "x": 5.4, "y": 1.71, "width": 36, "height": 29 } 216 | } 217 | } 218 | } 219 | ], 220 | "animations": { 221 | "idle": { 222 | "bones": { 223 | "left shoulder": { 224 | "rotate": [ 225 | { "angle": -3.77 }, 226 | { "time": 1, "angle": 9.51 }, 227 | { "time": 2, "angle": -3.77 } 228 | ] 229 | }, 230 | "right shoulder": { 231 | "rotate": [ 232 | { "angle": 11.08 }, 233 | { "time": 1, "angle": -1 }, 234 | { "time": 2, "angle": 11.08 } 235 | ] 236 | }, 237 | "head": { 238 | "rotate": [ 239 | {}, 240 | { "time": 1, "angle": 2.1 }, 241 | { "time": 2 } 242 | ] 243 | }, 244 | "torso": { 245 | "translate": [ 246 | {}, 247 | { "time": 1, "y": 2.9 }, 248 | { "time": 2 } 249 | ] 250 | } 251 | } 252 | }, 253 | "walk": { 254 | "slots": { 255 | "eyes": { 256 | "attachment": [ 257 | { "time": 0.7, "name": "eyes closed" }, 258 | { "time": 0.8, "name": null } 259 | ] 260 | } 261 | }, 262 | "bones": { 263 | "left upper leg": { 264 | "rotate": [ 265 | { "angle": -26.56 }, 266 | { "time": 0.1333, "angle": -8.79 }, 267 | { "time": 0.2333, "angle": 9.51 }, 268 | { "time": 0.3667, "angle": 30.74 }, 269 | { "time": 0.5, "angle": 25.34 }, 270 | { "time": 0.6333, "angle": 26.12 }, 271 | { "time": 0.7333, "angle": -7.71 }, 272 | { "time": 0.8667, "angle": -21.19 }, 273 | { "time": 1, "angle": -26.56 } 274 | ], 275 | "translate": [ 276 | { "x": -1.32, "y": 1.71 }, 277 | { "time": 0.3667, "x": -0.06, "y": 2.43 }, 278 | { "time": 1, "x": -1.32, "y": 1.71 } 279 | ] 280 | }, 281 | "right upper leg": { 282 | "rotate": [ 283 | { "angle": 42.45 }, 284 | { "time": 0.1333, "angle": 52.11 }, 285 | { "time": 0.2333, "angle": 8.54 }, 286 | { "time": 0.5, "angle": -16.94 }, 287 | { "time": 0.6333, "angle": 1.9 }, 288 | { "time": 0.7333, "angle": 28.06, "curve": 0.463, "c2": 0.12 }, 289 | { "time": 0.8667, "angle": 58.69, "curve": 0.5, "c2": 0.02 }, 290 | { "time": 1, "angle": 42.45 } 291 | ], 292 | "translate": [ 293 | { "x": 6.24 }, 294 | { "time": 0.2333, "x": 2.14, "y": 2.4 }, 295 | { "time": 0.5, "x": 2.44, "y": 4.8 }, 296 | { "time": 1, "x": 6.24 } 297 | ] 298 | }, 299 | "left lower leg": { 300 | "rotate": [ 301 | { "angle": -22.98 }, 302 | { "time": 0.1333, "angle": -63.51 }, 303 | { "time": 0.2333, "angle": -73.76 }, 304 | { "time": 0.5, "angle": 5.12 }, 305 | { "time": 0.6333, "angle": -28.3 }, 306 | { "time": 0.7333, "angle": 4.08 }, 307 | { "time": 0.8667, "angle": 3.53 }, 308 | { "time": 1, "angle": -22.98 } 309 | ], 310 | "translate": [ 311 | {}, 312 | { "time": 0.2333, "x": 2.56, "y": -0.47 }, 313 | { "time": 0.5 } 314 | ] 315 | }, 316 | "left foot": { 317 | "rotate": [ 318 | { "angle": -3.69 }, 319 | { "time": 0.1333, "angle": -10.42 }, 320 | { "time": 0.2333, "angle": -5.01 }, 321 | { "time": 0.3667, "angle": 3.87 }, 322 | { "time": 0.5, "angle": -3.88 }, 323 | { "time": 0.6333, "angle": 2.78 }, 324 | { "time": 0.7333, "angle": 1.68 }, 325 | { "time": 0.8667, "angle": -8.54 }, 326 | { "time": 1, "angle": -3.69 } 327 | ] 328 | }, 329 | "right shoulder": { 330 | "rotate": [ 331 | { "angle": 5.29, "curve": 0.264, "c3": 0.75 }, 332 | { "time": 0.6333, "angle": 6.65 }, 333 | { "time": 1, "angle": 5.29 } 334 | ] 335 | }, 336 | "right arm": { 337 | "rotate": [ 338 | { "angle": -4.03, "curve": 0.267, "c2": 0.01, "c3": 0.805, "c4": 0.99 }, 339 | { "time": 0.6333, "angle": 19.79, "curve": 0.307, "c3": 0.787, "c4": 0.99 }, 340 | { "time": 1, "angle": -4.03 } 341 | ] 342 | }, 343 | "right hand": { 344 | "rotate": [ 345 | { "angle": 8.99 }, 346 | { "time": 0.6333, "angle": 0.51 }, 347 | { "time": 1, "angle": 8.99 } 348 | ] 349 | }, 350 | "left shoulder": { 351 | "rotate": [ 352 | { "angle": 6.26, "curve": 0.339, "c3": 0.684 }, 353 | { "time": 0.5, "angle": -11.79, "curve": 0.282, "c3": 0.687, "c4": 0.99 }, 354 | { "time": 1, "angle": 6.26 } 355 | ], 356 | "translate": [ 357 | { "x": 1.15, "y": 0.24 } 358 | ] 359 | }, 360 | "left hand": { 361 | "rotate": [ 362 | { "angle": -21.24, "curve": 0.296, "c3": 0.756, "c4": 0.99 }, 363 | { "time": 0.5, "angle": -27.28, "curve": 0.241, "c3": 0.75, "c4": 0.97 }, 364 | { "time": 1, "angle": -21.24 } 365 | ] 366 | }, 367 | "left arm": { 368 | "rotate": [ 369 | { "angle": 28.38, "curve": 0.339, "c3": 0.684 }, 370 | { "time": 0.5, "angle": 60.09, "curve": 0.282, "c3": 0.687, "c4": 0.99 }, 371 | { "time": 1, "angle": 28.38 } 372 | ] 373 | }, 374 | "torso": { 375 | "rotate": [ 376 | { "angle": -10.28 }, 377 | { "time": 0.1333, "angle": -15.39, "curve": 0.546, "c2": 0.01, "c3": 0.819 }, 378 | { "time": 0.3667, "angle": -9.78, "curve": 0.58, "c2": 0.17, "c3": 0.67, "c4": 0.99 }, 379 | { "time": 0.6333, "angle": -15.75, "curve": 0.236, "c2": 0.01, "c3": 0.796 }, 380 | { "time": 0.8667, "angle": -7.07, "curve": 0.21, "c3": 0.816, "c4": 0.99 }, 381 | { "time": 1, "angle": -10.28 } 382 | ], 383 | "translate": [ 384 | { "x": -1.29, "y": 1.69 } 385 | ] 386 | }, 387 | "right foot": { 388 | "rotate": [ 389 | { "angle": -5.25 }, 390 | { "time": 0.2333, "angle": -1.91 }, 391 | { "time": 0.3667, "angle": -6.45 }, 392 | { "time": 0.5, "angle": -5.4 }, 393 | { "time": 0.7333, "angle": -11.69 }, 394 | { "time": 0.8667, "angle": 0.46 }, 395 | { "time": 1, "angle": -5.25 } 396 | ] 397 | }, 398 | "right lower leg": { 399 | "rotate": [ 400 | { "angle": -3.39, "curve": 0.316, "c2": 0.02, "c3": 0.741, "c4": 0.99 }, 401 | { "time": 0.1333, "angle": -45.53, "curve": 0.23, "c3": 0.739, "c4": 0.97 }, 402 | { "time": 0.2333, "angle": -4.83 }, 403 | { "time": 0.5, "angle": -19.53 }, 404 | { "time": 0.6333, "angle": -64.8 }, 405 | { "time": 0.7333, "angle": -82.56, "curve": 0.557, "c2": 0.18 }, 406 | { "time": 1, "angle": -3.39 } 407 | ], 408 | "translate": [ 409 | { "time": 0.5 }, 410 | { "time": 0.6333, "x": 2.19, "y": 0.21 }, 411 | { "time": 1 } 412 | ] 413 | }, 414 | "hip": { 415 | "translate": [ 416 | { "y": -4.16 }, 417 | { "time": 0.1333, "y": -7.06, "curve": 0.359, "c2": 0.47, "c3": 0.647, "c4": 0.75 }, 418 | { "time": 0.3667, "y": 6.78 }, 419 | { "time": 0.5, "y": -6.14 }, 420 | { "time": 0.6333, "y": -7.06, "curve": 0.359, "c2": 0.47, "c3": 0.647, "c4": 0.75 }, 421 | { "time": 0.8667, "y": 6.78 }, 422 | { "time": 1, "y": -4.16 } 423 | ] 424 | }, 425 | "neck": { 426 | "rotate": [ 427 | { "angle": 3.6 }, 428 | { "time": 0.1333, "angle": 17.5 }, 429 | { "time": 0.2333, "angle": 6.11 }, 430 | { "time": 0.3667, "angle": 3.46 }, 431 | { "time": 0.5, "angle": 5.18 }, 432 | { "time": 0.6333, "angle": 18.36 }, 433 | { "time": 0.7333, "angle": 6.09 }, 434 | { "time": 0.8667, "angle": 2.29 }, 435 | { "time": 1, "angle": 3.6 } 436 | ] 437 | }, 438 | "head": { 439 | "rotate": [ 440 | { "angle": 3.6, "curve": 0, "c3": 0.704, "c4": 1.18 }, 441 | { "time": 0.1333, "angle": -0.21 }, 442 | { "time": 0.2333, "angle": 6.11 }, 443 | { "time": 0.3667, "angle": 3.46 }, 444 | { "time": 0.5, "angle": 5.18, "curve": 0, "c3": 0.704, "c4": 1.62 }, 445 | { "time": 0.6667, "angle": 1.11 }, 446 | { "time": 0.7333, "angle": 6.09 }, 447 | { "time": 0.8667, "angle": 2.29 }, 448 | { "time": 1, "angle": 3.6 } 449 | ] 450 | } 451 | } 452 | } 453 | } 454 | } -------------------------------------------------------------------------------- /spine/goblins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandeu/phaser3-spine-example/585357610fa3f18979faa66abb60429008f6120e/spine/goblins.png --------------------------------------------------------------------------------