# bannercvtr

## Description

TWL Banner Converter is a command-line tool that converts either cell animations created with NITRO-CHARACTER or NBF files created with `ntexconv` into binary files for use as TWL banner icons.

## Using the Tool

### Start Command

`% bannercvtr.exe [option] NCE_FILE | XML_FILE`

`NCE_FILE` specifies an NCE file (cell animation) created with NITRO-CHARACTER.

`XML_FILE` specifies an XML file that describes the contents of the NBF files created with `ntexconv` as well as the content of the animation.

The `-h` option displays simple instructions.

The `--version` option displays the version of `bannercvtr`.

The `-o <output file>` option specifies the output file.

The `-x` option converts an NCE file created with NITRO-CHARACTER into NBF files and an XML file for the banner icon.

The `-v` option displays detailed information about the conversion.

## Converting Cell Animations Created with NITRO-CHARACTER

For information on how to create cell animation data (`*.nce`) for TWL banners using NITRO-CHARACTER, see Banner Creation Procedure Using NITRO-CHARACTER.

### Start Command

Running the following command from the command line outputs a binary file in the same folder as the NCE file. This file has the same name as the NCE file except that its file extension is BIN.

`% bannercvtr.exe data.nce`

The output file can also be specified as shown below.

`% bannercvtr.exe -o C:\data\output.bin data.nce`

The NCG and NCL files that are referenced by the NCE file must be saved in either the same project or the same folder as the NCE file.

## Converting NBF Files Created with ntexconv

### Start Command

#### Creating NBF Files

Use `ntexconv` to convert image files to NBF files. Run `ntexconv` with options like those shown below.

`% ntexconv.exe -no -bg -bgb -bgnc -f palette16 image0.bmp`

When assigning the transparent color 0 to an image file with an alpha channel specified, use the `-ta` option. When transparent colors (RGB) are specified, use the `-tc` option. Although NBFC, NBFP, and NBFS files are created after running `ntexconv`, NBFS files are not used with the TWL Banner Converter.

#### Creating XML Files for Banner Icons

This creates the NBF files used for the banner icon, as well as an XML file which encodes the animation content. The format of the XML file is explained in the next section.

#### Running TWL Banner Converter

Running the following command from the command line outputs a binary file in the same folder as the XML file. This file has the same name as the XML file except that its file extension is BIN.

`% bannercvtr.exe data.xml`

The output file can also be specified as shown below.

`% bannercvtr.exe -o C:\data\output.bin data.xml`

### Format of XML Files for Banner Icons

#### Example XML File for a Banner Icon

>     <?xml version="1.0" encoding="Shift_JIS"?>
>     <banner>
>     <character_array>
>         <character>character0.nbfc</character>
>         <character>character1.nbfc</character>
>     </character_array>
>     <palette_array>
>         <palette>palette0.nbfp</palette>
>     </palette_array>
>     <animation loop_mode="loop">
>         10 0 0 N
>         20 1 0 N
>          5 0 0 N
>     </animation>
>     </banner>

> `<character_array>`
>   Use the `<character_array>` element to list the NBFC files (character data) to use. Up to 8 `<character_array>` elements can be listed.
>   If the path of an NBFC file is not a full path, it is interpreted as a relative path from the folder where the XML file is located.
> `<palette_array>`
>   Use the `<palette_array>` element to list the NBFP files (palette data) to use. Only 1 `<palette_array>` element can be listed.
>   If the path of an NBFP file is not a full path, it is interpreted as a relative path from the folder where the XML file is located.
> `<animation>`
>   Encodes the content of the animation.
>   Specify the behavior of the animation using the `loop_mode` attribute. To loop, use `loop`. To stop after the last frame, use `stop`. You can code sets of key data in `<animation>`, as shown below.

>       [Number of frames] [Character Number] [Palette Number] [Flip]
>           (Do not use brackets in the actual file.)

>   Include as many sets of key data as necessary.
>   Number of frames is the number of frames displayed using the designated character, palette, and flip setting. The maximum number of frames is 255. Specifying 0 causes the given item of key data to be ignored.
>   Character Number is the character's number within `<character_array>`. The first `<character>` element is 0.
>   Palette Number is the number of the `<palette_array>`. It should always be set to 0.
>   `N` is always used for flip. (The flip feature has been removed. Specifying `H`, `V`, `VH` or `HV`, which had previously been usable, will result in an error.)
>   If the `loop_mode` attribute is `stop`, the maximum number of key data sets is 63. If the `loop_mode` attribute is `loop`, the maximum number of key data sets is 64.

### Outputting NBF Files and an XML File for the Banner Icon

Running the following command from the command line converts an NCE file created with NITRO-CHARACTER into NBF files and an XML file for the banner icon.

`% bannercvtr.exe -x data.nce`

This outputs an XML file and some NBF files to the same folder as the NCE file. The XML file has the same name as the NCE file except that its file extension is XML. The NBF files are output with the names `character0.nbfc, character1.nbfc, character2.nbfc, ...` (for character data) and the names `palette0.nbfp, palette1.nbfp, palette2.nbfp, ...` (for palette data). If the `-x` option is specified, a binary file for the banner icon is not output.

It is also possible to specify the XML file that is output, as shown below. (The NBF files are output to the same directory as the XML file).

`% bannercvtr.exe -x -o C:\data\output.xml data.nce`

The NCG and NCL files that are referenced by the NCE file must be saved in either the same project or the same folder as the NCE file.

## Location

`$TwlSDK/tools/bin/bannercvtr.exe`

## See Also

Banner Overview
`makebanner.TWL`
`ntexconv`
Banner Creation Procedure Using NITRO-CHARACTER

## Revision History

2011/04/08 Added that the flip feature was removed.
2008/11/04 Added animation limitations.
2008/09/12 Initial release.

CONFIDENTIAL