# 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 will convert 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 where the NCE file is. This binary file has the same name as the NCE file except its file extension is `.bin`.

`% bannercvtr.exe data.nce`

The output file can also be specified as follows.

`% 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 based on the alpha channel of the image file, use the `-ta` option. When assigning the transparent color 0 by specifying the transparent color (R,G,B), 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 an XML file that describes the NBF files used for the banner icon and the content of the animation. 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 where the XML file is. This file has the same name as the XML file except 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 H
>     </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>`
>   Lists the content of the animation.
>   Specify the behavior of the animation using the `loop_mode` attribute. To loop, specify `loop`; to stop after the last frame, specify `stop`. Specify sets of data on a line in the `<animation>` element as follows.

>       Number of frames   Character No.   Palette No.   Flip

>   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 entry to be ignored.
>   Character No. is the number in `<character_array>`. The first `<character>` element is 0.
>   Palette No. is the number of the `<palette_array>`. It should always be set to 0.
>   Flip is "N" for no flip, "H" for a horizontal flip, "V" for a vertical flip, or "VH" (or "HV") for a combined horizontal and vertical flip.
>   It is not possible to change the flip only using the same character number from the previous key data.
>   To change the flip, be sure to change the character number, too.
>   When making a loop setting, the same restrictions apply to the last key data and the first key data.
>   If the `loop_mode` attribute is `stop`, the maximum number of data sets is 63. If the `loop_mode` attribute is `loop`, the maximum number of 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 in the same folder where the NCE file is. The XML file has the same name as the NCE file except its file extension is `.xml`. The NBF files is 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 in 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

2008/11/04 Added animation restrictions.
2008/09/12 Initial version.

CONFIDENTIAL