johnedvard

Hello.
Is it possible to export the texture atlas file as a .json file instead of an .atlas file? I want to use the atlas in a Phaser project, but they only accept .json atlases.

I tried changing the "Atlas extension" to .json instead, but it did not work. I am using Spine version 3.8.96

Screenshot 2020-07-09 at 13.09.00.png
Bạn không được cấp phép để xem tập tin đính kèm trong bài viết này.
Hình đại diện của thành viên
johnedvard
  • Bài viết: 7

Erika

Hello,
from what I'm seeing from Phaser's examples, they do accept atlas files, in combination with their json file of course :D
https://phaser.io/examples/v3/category/spine

So I think you can choose the Json export that will generate 3 files: the Json, the atlas, and the png/jpeg.
https://github.com/azerion/phaser-spine#usage
Hình đại diện của thành viên
Erika

Erikari
  • Bài viết: 2548

johnedvard

Thanks for the prompt reply.
I should have been more clear in my question I think. I am not using the Spine Plugin.

I want to load an atlas using Phaser's LoaderPlugin, like this:
this.load.atlas('mainmenu', 'images/MainMenu.png', 'images/MainMenu.json');
Here is a practical example from their web site: https://phaser.io/examples/v3/view/animation/texture-atlas-animation

I really like the texture packer from Spine, so I was hoping I could export the atlas in .json format, if possible.
Hình đại diện của thành viên
johnedvard
  • Bài viết: 7

Nate

Sorry, Spine only supports the .atlas texture atlas file format. You could write a tool that converts the data to JSON or you could probably port the Phaser code that loads the .atlas files to do what you need. Otherwise you'd need to use a different texture packing tool, eg this one is fully featured:
https://www.codeandweb.com/texturepacker
Hình đại diện của thành viên
Nate

Nate
  • Bài viết: 9847

johnedvard

Thanks again for the prompt reply.

Understood, and thanks for the suggestions ;)
Hình đại diện của thành viên
johnedvard
  • Bài viết: 7


Quay về Editor