Game Development Reference
In-Depth Information
The build styles project
This is a very simple example demonstrating the use of build styles, resource
templates, and deployment types. It is based on the Graphics2D example from
Chapter 2
,
Resource Management and 2D Graphics Rendering
.
The
resbuildstyles.itx
file defines a build style called
highres
that specifies a
prefix directory called
data-highres
. If you look inside the
data
directory, you will
see that the jar of the marmalade image in
data\images\textures\marmalade.png
is 256 x 256 pixels in size. A new directory for the
highres
build style has also been
added, containing a 512 x 512 version of this image. This file is called
data\data-
highres\images\textures\marmalade.png
.
If you now look at the
app.icf
file, you will see the new entry
ResBuildStyle=highres
. If you run the program with this line in place, the 512 x
512 version of the image will be loaded. Comment out or remove this line, and the
256 x 256 image will be loaded.
The
restemplates.itx
file shows a simple example of a resource template that
will force the images to be converted into RGBA4444 format and also disables
mipmapping. This resource template is used in the
data\images\images.group
ile
to reduce the size of the
images.group.bin
file as no mipmap images need to be
stored in it.
Finally, the
BuildStyles.mkb
file declares two deployment types called
normal
and
highres
. When making an install package using the
Marmalade System Deployment
Tool
, we can select either of these options to include the low or high resolution images.
Note that the deployment tool will also list the default deployment type as this is
always defined automatically by the deployment tool. Using the default type will not
include any resources and so will not work on the device.
The Skiing project
For this chapter the Skiing project has been updated to use build styles, resource
templates, and deployment types. It also makes use of Derbh archives to reduce the
size of the install package.
In this instance the build styles system has been used to allow a larger size of font to
be used on devices with a higher screen resolution. The
data\data-highres\ui\
fonts
directory contains alternative versions of the font files
skiing.gxfont
and
skiing.tga
that will be loaded when the
highres
build style has been selected in
the
app.icf
file.
Search WWH ::
Custom Search