• Off-topic
  • Scripts i am tempted to make

Spine Text script
this would allow you to import text into your spine project from a file. rather than importing whole images of words / sentences this script would use individual letters and place them into spine. You would select a .txt file, then the content of that file would appear in a spine skeleton json, which you could import into your project. The advantage of this is it would pack your images much more efficiently than if you where to use images for words, and it would take the hassle out of placing letters yourself.

Problem with this is I would have to work out the kernings

Path Animation

This would take in a .png of a line and it would scan the image looking for the line, then it would create a json of a bone following that line. This one is much more complex but lots of people request path animation.

Would anybody be interested in the above scripts?

Related Discussions
...

For the text script, you could use gdx-freetype in libgdx. This is a FreeType wrapper which gives you access to the font metrics and kerning. The easy way to do it is to use FreeTypeFontGenerator to generate a BitmapFont from a TTF (or OTF) file at the size you want. Next, GlyphLayout will tell you where all the glyphs go for a given piece of text. It uses kerning, supports line wrapping, etc. You would output Spine JSON using the information GlyphLayout provides. It gives glyph positions, UVs, etc. You can then use BitmapFontWriter in gdx-tools to write all the BitmapFont glyphs to a single image file. For the best glyph packing when you know all the glyphs ahead of time, I suggest the PixmapPacker.SkylineStrategy for the FreeTypeFontParameter you use to generate your font, but I'd get the rest working first.

You'll come to find libgdx is awesome! 😃 BTW, I saw on IRC you were talking about build times. With Java, you can edit code while your app is running and most changes will be hot swapped into your running app. The time this saves is huge, because you don't have to restart your app and get back to the same state just to test a change.

For path animation, we hope to get it in Spine soonish.

libGDX is super awesome. 😉

Nate ha scritto

For the text script, you could use gdx-freetype in libgdx. This is a FreeType wrapper which gives you access to the font metrics and kerning. The easy way to do it is to use FreeTypeFontGenerator to generate a BitmapFont from a TTF (or OTF) file at the size you want. Next, GlyphLayout will tell you where all the glyphs go for a given piece of text. It uses kerning, supports line wrapping, etc. You would output Spine JSON using the information GlyphLayout provides. It gives glyph positions, UVs, etc. You can then use BitmapFontWriter in gdx-tools to write all the BitmapFont glyphs to a single image file. For the best glyph packing when you know all the glyphs ahead of time, I suggest the PixmapPacker.SkylineStrategy for the FreeTypeFontParameter you use to generate your font, but I'd get the rest working first.

You'll come to find libgdx is awesome! 😃 BTW, I saw on IRC you were talking about build times. With Java, you can edit code while your app is running and most changes will be hot swapped into your running app. The time this saves is huge, because you don't have to restart your app and get back to the same state just to test a change.

For path animation, we hope to get it in Spine soonish.

cool, thanks for the info! who knew libgdx was that usful huh 😃