• Editor
  • How to Properly Prepare and Use Ninepatch in Spine for PixiJS?

Hi everyone,

I’m working on a game using Spine and PixiJS, and I’m having trouble getting a ninepatch to work correctly in PixiJS. Here’s what I’ve done so far:

  1. The Asset:

    • I have a red neon border image that I’m using in Spine.
    • The image is prepared as a ninepatch with a 1px transparent border and black lines marking the edges (file name ends with .9.png).
  2. In Spine:

    • I’ve created an animation where I’m using this neon border as an attachment.
    • The animation only modifies the rotation, scale, and opacity of a mask and the opacity of the neon border. The neon border itself doesn’t move.
    • The attachment is set up as a ninepatch in Spine, and the splits are correctly defined.
  3. Export:

    • When I export the project from Spine, the attachment is exported correctly:
      • The black lines are removed.
      • The atlas file includes the correct splits for the ninepatch.
  4. The Problem:

    • When my colleague tries to use this animation in PixiJS, the ninepatch doesn’t work as expected.
    • The skeleton/attachment behaves as if it’s not a ninepatch at all (e.g., it scales uniformly instead of preserving the borders and corners).

What I’ve Tried:

  • Ensuring the image is correctly marked as a ninepatch in Spine.
  • Verifying that the splits are properly defined in the exported atlas.
  • Checking that the Spine runtime for PixiJS is correctly set up.

Questions:

  • Am I missing a step in preparing the ninepatch in Spine?
  • Are there any specific settings or steps required in PixiJS to properly handle Spine’s ninepatch attachments?
  • Could this be an issue with the Spine runtime for PixiJS?

Any advice or guidance would be greatly appreciated! Thank you in advance for your help.

Related Discussions
...

Our runtimes generally don't do anything special with ninepatches. Our pixi runtime is not an exception.
You can pack them as the user guide says, but that's it.