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...

4

2 回答 2

3

我们添加了对带有TexturePacker 3.6.0的 Phaser 的官方支持。

JSON 数组和 JSON 数据现在可从框架选择器中获得。

我们还创建了一个简单的教程,向您展示如何使用它。

于 2014-12-23T14:40:59.520 回答
1

我还将 TexturePacker 与 Phaser 一起使用。工作很棒。

我用:

  • JSON(数组)
  • 最大尺寸 2048
  • 约束 POT
  • 允许旋转:禁用
  • 边框填充:2
  • 形状填充: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");
于 2014-10-22T14:10:26.680 回答