Game Development Reference
In-Depth Information
Additionally, the
app.config.txt
file also requires you to define a group name for
your settings, which is specified by using square brackets.
If you look at the
s3eConfigGetString
function call in the "Hello World" project
code, you will see an example of this. This call is trying to access a setting called
Message
from the group
APP
, so let's add this into the
app.config.txt
file now, to
stop any asserts from firing when running our application. Edit the file and add the
following lines to the bottom of it:
[APP]
Message The message we want to display on screen
The app.icf file
The
app.icf
file is used to add the configuration settings to your application, and
as already stated these must be either documented in your project's
app.config.
txt
file or must alternatively be defined in a similar file within one of the subprojects
used by your application.
Adding a configuration setting is simply a matter of adding the setting name
followed by an equals sign and then the value you wish to use. You must also ensure
that you add the setting to the correct group, using the same square bracket notation
used in the
app.config.txt
file. Here's an example:
[APP]
Message="Hello World"
The settings made in the
app.icf
file can then be accessed in code using the
s3eConfigGetInt
and
s3eConfigGetString
functions.
The
app.icf
file also has another couple of tricks up its sleeve, as settings can also be
made that are specific to a certain platform or even specific to an individual device.
Here's how you achieve this:
• To limit the application to a particular platform add the line
{OS=platform}
,
and any settings following this will only apply to that device platform. The
value used for
platform
is normally just the name of the operating system,
for example,
ANDROID
,
BADA
, or
WINDOWS
, although it is worth mentioning
that you should use
IPHONE
to refer to iPhones, iPods, and iPads! If in doubt,
you can use a call to
s3eDeviceGetString(S3E_DEVICE_OS)
to discover the
value that you need to use for a particular operating system.
Search WWH ::
Custom Search