How to use GfxCrunch (Animated Object Sprites): Difference between revisions

simplified headers, added memory explanation
m <Frame>: simplified formatting, added decimal formats for clarification
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
GfxCrunch uses the following folders and files to generate object sprites.
GfxCrunch uses the following folders and files to generate object sprites.


== Imgs Folder ==
== imgs Folder ==
This is a folder of all image sprites used in the animations. Images are labeled from <code>0000.png</code>, <code>0001.png</code>, <code>0002.png</code>, etc. These images have to be i''ndexed images'' and fit within GfxCrunch’s sizes (16 x 16 or multiples of that are safe starting points).
This is a folder of all image sprites used in the animations. Images are labeled from <code>0000.png</code>, <code>0001.png</code>, <code>0002.png</code>, etc. These images have to be ''indexed images'' and fit within GfxCrunch’s sizes (16 x 16 or multiples of that are safe starting points).


== palette.pal ==
== palette.pal ==
Line 17: Line 17:
== frames.xml ==
== frames.xml ==
Contains data for image frames.
Contains data for image frames.
A <code><FrameGroup></code> is made up of x amount of <code><Frame></code> images, ''if'' it needs to form a bigger sprite. If a sprite is going to be just one image (eg: one PNG from the <code>imgs</code> folder), each PNG that will be used for animations ''needs to be in its own <code><FrameGroup></code>. If not, this will cause memory issues and/or crashes when displaying the object in cutscenes.''
See the definitions of the XML tags below.


=== <FrameGroup> ===
=== <FrameGroup> ===
Line 23: Line 27:
=== <Frame> ===
=== <Frame> ===
Indicates a single image sprite.
Indicates a single image sprite.
A <code><FrameGroup></code> is made up of x amount of <code><Frame></code> images, ''if'' it needs to form a bigger sprite. If a sprite is going to be just one image (eg: one PNG from the <code>imgs</code> folder), each PNG that will be used for animations ''needs to be in its own <code><FrameGroup></code>. If not, this will cause memory issues and/or crashes when displaying the object in cutscenes.''


==== <ImageIndex> ====
==== <ImageIndex> ====
The image index of the frame. This correlates with the image number in the imgs folder.
The image index of the frame. This correlates with the image number in the <code>imgs</code> folder.


==== <Unk0> ====
==== <Unk0> ====
Line 39: Line 41:


==== <Unk15> ====
==== <Unk15> ====
Correlates to ''each <code><Frame></code>'' in '''one''' <code><FrameGroup></code>, used for memory allocation and layering. If there are multiple <code><Frames></code> in a <<code>FrameGroup></code> , increment this value.
Correlates to ''each '''Frame''''' in ''one'' '''FrameGroup''', used for memory allocation and layering. If there are '''multiple''' '''Frames''' in a '''FrameGroup''', '''increment''' this value in each entry.


Value needed to start with/increment depends on the size of the sprite. Ideally:
Value needed to start with and/or increment depends on the resolution size of the sprite. Ideally:


* 8x8 frame (smallest size) requires <code>0x1</code>
* 8x8 frame (smallest size) requires <code>0x1</code> (1 in decimal)
* 16x32 frame requires <code>0x2</code>  
* 16x32 frame requires <code>0x2</code> (2 in decimal)
* 32x64 frame requires <code>0x8</code>  
* 32x64 frame requires <code>0x8</code> (8 in decimal)
* 32x32 frame requires <code>0x4</code>
* 32x32 frame requires <code>0x4</code> (4 in decimal)
* 64x64 frame (largest size) requires <code>0x10</code>
* 64x64 frame (largest size) requires <code>0x10</code> (16 in decimal)


The number is represented in hexadecimal, so 0x0 is 0... 0xc is 12, 0x10 is 16, etc.  
The number is represented in hexadecimal, so 0x0 is 0... 0xc is 12, 0x10 is 16, etc.