pixijs/spine

What's the difference between pixijs/spine and @esotericsoftware/spine-pixi?

YunYouJun opened this issue · 5 comments

I see official spine has a @esotericsoftware/spine-pixi package.

What's the difference between pixijs/spine and @esotericsoftware/spine-pixi?

I think it would be meaningful if that could be explained in the README.

Woah! I didn't realize it was already published 😅

The difference is that the @esotericsoftware/spine-pixi uses the official runtime while this repo has a recreated version of the runtime.

The "runtime" is the logic part that does the math and calculations of where each bone should be depending on which animation is playing.


@esotericsoftware/spine-pixi

Pro

  • When Spine updates, the library should update at the same time.

Con

  • Esoteric Software only supports the latest version of spine. So if you want to run old spines (3.8) your mileage may vary.

pixijs/spine

Pro

  • Supports old versions of spine and is more "hackable" since the runtime is part of the project

Con

  • When a new version is released, you need to wait or patch the runtime yourself to work.
  • All texture-related stuff is default-pixi , instead of spine textureAtlas
  • matrices in bones are PIXI.Matrix
  • hackTexture method
  • some old stuff like flipX that was removed from original runtime but exists here, because people use it

Can I understand that?
If I want to use the latest spine and don't care about compatibility, I can use @esotericsoftware/spine-pixi.
And if I want some hacks and compatibility with older versions I can use pixi/spine.

In the future, is it possible for pixi/spine to partner with @esotericsoftware/spine-Pixi to maintain only one future release?

The approach is fundamentally different, that's why you can't reconcile the two.

pixi-spine recreates the entire spine runtime to use pixi matrices and texture atlases and that allows It to have features like the ones Ivan described above. The downside is that this makes is a more complex codebase.

The one at esotericsoftware just works arround the official runtime (that's logic only) and implements a renderer to that runtime. This makes it simpler but less hackable.


Oversimplifying,

pixi-spine bends and twists spine to fit pixi.

EsotericSoft bends and twists pixi to fit spine.

OK, thank you for your detailed explanation.
Would you consider adding a description to the README?