1

Can anyone describe TexturePacker settings that work for phaser? I am using an atlas with the JSON hash format to place objects in my game... they are not even animated. But I am getting many "Cannot set frameName: someimage.gif" errors... what am i doing wrong? I actually did get it right once, with the free version of TexturePacker... then I bought it, tried to make some changes and cannot get it right again!

My TexturePacker settings:

Data:

Data Format: json (hash)

Texture

Texture format: PNG Pixel format: RGBA8888

Layout

Max size W/H: 4096 Size constraints: POT (Power of Two) Force squared: on Allow Rotation: off Detect identical Sprites: on

Sprites

Trim mode: Trim Trim/Crop Threshold: 1 Pivot Point: Center Extrude: 0 Border padding: 0 Shape padding: 0 Inner Padding: 0 Common divisor x: 1 y: 1

and nothing else turned on...

Meg
  • 1,462
  • 12
  • 23
Regis Zaleman
  • 3,182
  • 6
  • 29
  • 30

2 Answers2

3

We've added official support for Phaser with TexturePacker 3.6.0.

The JSON array and JSON data are now available from the framework selector.

We've also created a simple tutorial showing you how to use it.

Andreas Löw
  • 1,002
  • 8
  • 15
1

I also use TexturePacker with Phaser. Work's great.

i use:

  • JSON(Array)
  • Max Size 2048
  • constraint POT
  • allow rotation: disable
  • border padding:2
  • shape padding: 2

Javascript:

// Load atlas
this.game.load.atlas('atlas-interface', 'assets/images/atlas_interface.png', 'assets/images/atlas_interface.json');

// Sprite creation
this.game.add.sprite(0, 0, "atlas-interface", "image1.png");
MamaWalter
  • 2,073
  • 1
  • 18
  • 27