• Editor
  • Positional Data in Sprite Sheets

Related Discussions
...

I am currently working on a student project in a custom made engine. We opted not to use the runtime library for loading in animations, and instead are going the old school sprite sheet route due to time constraints. The project is a 2D side view shooter, and something that would be incredibly beneficial to me currently is being able to export positional data of a specific point (in this case it is the point that I would like to spawn bullets/projectiles) for each frame of animation. E.g. Sprite sheet gets exported into eight 32x32 frames, the spawn point for projectiles moves per frame, and I'd like to have the pixel coordinates of the spawn point per frame.

Is this something that is possible in Spine? If it's not, one of the alternatives that I can think of is keying every frame of a bone that is stuck at the tip of the cannon, parsing the json files, and doing a ton of my own calculations to figure out where that point would be in an exported spritesheet after scaling. I know I could do that, but I'd rather not.

Or maybe there is something better to do besides what I just mentioned or throwing the spritesheet into photoshop and visually figuring out the locations and manually typing them in? Any help would be greatly appreciated.

Choose the "grid" type of packing for the texture packer settings.

Correct me if I'm wrong, but from what I can glean from packing in grid type, it will make all animations fit into one size fit all and space them out in a grid instead of efficiently packing them into a texture. This isn't the issue I am facing, and I've already solved offsetting frames correctly with non-uniform sized animations for a character.

HTTPS をサポートしていないため、画像は非表示になっています。 | まだ表示する

This is an example of what I am working on. The character has multiple angles that he can aim in, and I'm trying to see if Spine can export an xy coordinate of the tip of his cannon, so I can just read that in from a file to find the correct location to spawn projectiles. I believe Spriter has something that solves this particular issue, and I wasn't sure if Spine also supported the same feature.

Anyway, I have a hacky way to accomplish what I need that will be good enough, I was just trying to see if there is something that maybe I missed while reading through the documentation and looking through all of the options.

I would export the file as a JSON then implement one of the spine runtimes in a Command Line application (CSharp being my preferred, but whatever floats ur boat) and just process the data. Look for a bone, and sample the animations you want then out put the result to a file. Probably only take 30min or so to write a CLI app to do what you want. Each bone has a WorldX, WorldY, and WorldRotation property so you dont have to worry about dealing with the hierarchy.

Actually, I may do that. I didn't really think of just using the spine runtimes to process and pin point what I need and outputting that to a file. I kind of got wrapped up in not using the runtimes at all since we decided to use Spine late in our development cycle and didn't want to take the time to integrate it and fully test it with our engine when we have a submission deadline in 4 weeks. Content + polish > adding new systems.

At least it will get my feet wet with how to use the libraries for future 2D projects. Thank you sir.

Oops, sorry I didn't comprehend your first post very well! :$

Using a runtime is the best way to do it for now. There's some complexity for the Spine export to add this feature, since it can export multiple skeletons at once. The plotting can be done with any generic runtime, since no rendering is needed. I added an example to do it with spine-libgdx:
https://github.com/EsotericSoftware/spi ... g.java#L40

Output:

death,62.84088,73.708115,-76.130005,1.0,1.0
death,285.23337,375.3828,-6.8776894,1.0,1.0
death,78.18911,712.87915,62.35711,1.0,1.0
death,-108.246895,739.26,96.58567,1.0,1.0
death,-283.71326,516.249,130.8044,1.0,1.0
death,-355.32132,281.37787,155.18718,1.0,1.0
death,-363.88428,35.17488,179.57,1.0,1.0
death,-358.27167,98.83792,165.60007,1.0,1.0
death,-332.43683,117.32389,161.05147,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
death,-336.83765,69.47505,170.44,1.0,1.0
hit,1.8849487,5.200592,312.00995,1.0,1.0
hit,70.00103,104.29866,330.79483,1.0,1.0
hit,118.26724,211.23529,349.36298,1.0,1.0
hit,145.2069,317.76434,367.58762,1.0,1.0
hit,146.60803,398.11804,385.32892,1.0,1.0
idle,291.73346,374.43222,369.22998,1.0,1.0
idle,292.2815,374.25974,369.3331,1.0,1.0
idle,293.53876,374.34006,369.65506,1.0,1.0
idle,295.2842,373.43237,369.87573,1.0,1.0
idle,297.50177,370.18427,369.6469,1.0,1.0
idle,299.84406,365.3961,369.10968,1.0,1.0
idle,302.20337,358.94043,368.1879,1.0,1.0
idle,304.33948,350.97256,366.89517,1.0,1.0
idle,306.10596,342.05862,365.33032,1.0,1.0
idle,307.4204,333.0064,363.6533,1.0,1.0
idle,308.29926,324.65384,362.0202,1.0,1.0
idle,309.22046,316.79825,360.40552,1.0,1.0
idle,310.103,312.78754,359.43295,1.0,1.0
idle,310.6283,310.7668,358.76224,1.0,1.0
idle,310.71014,311.09903,358.54388,1.0,1.0
idle,310.47363,312.07184,358.36453,1.0,1.0
idle,309.86197,315.02274,358.57614,1.0,1.0
idle,308.74603,318.9194,358.9493,1.0,1.0
idle,307.25806,324.20667,359.63495,1.0,1.0
idle,305.36285,330.41418,360.51816,1.0,1.0
idle,302.8614,338.66635,361.92502,1.0,1.0
idle,300.10602,347.77884,363.6114,1.0,1.0
idle,297.18118,357.2907,365.5437,1.0,1.0
idle,294.3968,366.24765,367.4759,1.0,1.0
idle,292.4002,372.39606,368.8212,1.0,1.0
jump,284.06357,219.4263,362.47995,1.0,1.0
jump,224.09024,364.51074,347.08328,1.0,1.0
jump,139.16875,385.37595,331.68668,1.0,1.0
jump,41.112785,366.9261,316.28998,1.0,1.0
jump,168.19707,560.5716,351.7311,1.0,1.0
jump,227.65207,710.839,369.86887,1.0,1.0
jump,269.63074,777.28186,370.70322,1.0,1.0
jump,275.62534,804.0859,366.14542,1.0,1.0
jump,241.23274,796.5108,356.20624,1.0,1.0
jump,196.71376,788.2913,346.26703,1.0,1.0
jump,167.22409,822.06476,347.151,1.0,1.0
jump,108.38307,796.83014,331.9672,1.0,1.0
jump,-137.15027,1105.5188,474.8532,1.0,1.0
jump,-220.27429,934.7808,516.9219,1.0,1.0
jump,-164.65068,954.2755,493.77646,1.0,1.0
jump,-116.177284,912.4668,476.705,1.0,1.0
jump,-153.6857,739.76514,487.58612,1.0,1.0
jump,-214.42723,406.48172,520.2836,1.0,1.0
jump,-55.878197,505.79858,467.67352,1.0,1.0
jump,160.63254,440.15652,415.0635,1.0,1.0
run,239.69418,402.83466,389.61,1.0,1.0
run,217.63239,405.31012,398.4973,1.0,1.0
run,192.56288,190.11763,342.57196,1.0,1.0
run,-30.851372,145.34373,274.00452,1.0,1.0
run,-233.70909,222.3181,221.42157,1.0,1.0
run,-252.0207,198.0451,216.44441,1.0,1.0
run,-270.06577,200.06102,210.52817,1.0,1.0
run,-291.06567,270.11438,185.92813,1.0,1.0
run,-255.0686,166.07732,203.46848,1.0,1.0
run,116.02216,53.106216,292.65668,1.0,1.0
run,286.1493,294.1218,353.22922,1.0,1.0
run,283.84866,321.06195,363.2078,1.0,1.0
shoot,233.61523,131.61458,317.75662,1.0,1.0
shoot,220.34785,140.64864,317.75662,1.0,1.0
shoot,213.03311,145.62714,317.75662,1.0001235,1.0002578
shoot,222.33588,134.65265,317.75662,1.247,1.516
shoot,218.63022,137.1759,317.75662,1.247,1.516
shoot,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
test,225.05045,131.82513,317.75662,1.247,1.516
walk,200.47324,118.84268,308.62,1.247,1.516
walk,241.53674,159.69185,322.44247,1.247,1.516
walk,247.0505,167.87271,326.08636,1.247,1.516
walk,227.96503,154.16243,322.67462,1.247,1.516
walk,207.45155,138.24153,319.7014,1.247,1.516
walk,180.1347,117.58954,314.46896,1.247,1.516
walk,139.90878,87.5945,305.31,1.247,1.516
walk,132.28587,73.8546,301.6175,1.247,1.516
walk,107.164795,57.542862,291.83618,1.247,1.516
walk,90.42934,51.368958,284.16367,1.247,1.516
walk,102.84532,59.867416,284.69244,1.247,1.516
walk,154.89981,88.0226,296.65707,1.247,1.516