Atlas Creator

From FIFE development wiki
Jump to: navigation, search

Introduction

Since version 0.3.3, FIFE is able to use atlases. In order to create them we provide a simple tool called Atlas Creator. The only dependency is Qt4.

Interface

First thing you normally do after you run Creator is to select which images you would like to group together into one atlas. You can do it by selecting one directory and all of its children (Add directory) or n files (Add textures). At any time you can remove selected images by clicking on Remove texture

Ac main.png

Checkbox Show full path will swap from showing full path and only a basename. The latter will however be changed after atlas is generated to show not only a filename but a full common path.

Pressing Disassemble button will let you break already existing atlas with valid .xml file.

On 2nd tab you can tweak parameters:

  • Power of two atlases - indicates if the output image should be padded to next power of two - f.e. 890x373 will be padded with transparent pixels to a size of 1024x512
  • Maximum allowed width and Maximum allowed height - self explanatory
  • Try to shrink - if checked, atlas will be shrink to the smallest possible size, if the first option is checked it will be smallest size of power of two.
  • Namespace - optional, here we can set the namespace for every object created with atlas. If empty, namespace will be set to a basename of output file without an extension (so nature.png makes namespace = nature)
  • Root directory - this can be set only after atlas is generated and it's reseted after every generation. It's used to append part of a sub-images common path to their output names. First value is default one and is always equal to the shortest common path.
  • Generate - takes current image list and tries to generate an atlas from it. If you need to add/remove some of images you should 'refresh' output by regenerating atlas again. If you selected too much images or some of them are bigger than total atlas space you will be advised about it. In that case, try to remove some of them and try to generate the atlas again.
  • Save - after successful atlas generation you can save it using this button.
  • Alpha blending - if checked, output image is shown as it would look with alpha blending
  • Show occupation - changes sub-images to simple, colored quads to show what part of atlas is taken. Can be used to investigate how much space left.

After the atlas is generated you can inspect the output image by zooming in/out with mouse wheel and move it by dragging the mouse. Additionally, when you select image(s) from a 1st tab Creator will show you where this/these image(s) is/are placed in the output atlas by highlighting its/their border.

FIFE objects

3rd tab Object editor allow you to add FIFE object definitions. You can create new definition and remove or modify existing one. The list of available images is only available after atlas has been generated.

For now, Creator can only handle objects without animation. In order to use them check animated spritesheets.

Ac object.png