Game Development Reference
In-Depth Information
The s3eDevice API allows us to find out which language is currently in use on the
device we are running on. Simply insert the following line of code during the startup
portion of your game code:
int32 lLanguage = s3eDeviceGetInt(S3E_DEVICE_LANGUAGE);
The return value will be a member of the s3eDeviceLanguage enumeration, for
example S3E_DEVICE_LANGUAGE_ENGLISH or S3E_DEVICE_LANGUAGE_GERMAN . A full
list of all possible language codes can be found in s3eDevice.h .
With the language type determined by this call, we can then load the correct table
of strings and the user will magically get to see your game in their own language,
assuming you've supported it of course!
Example code
There are three example projects associated with this chapter, which are described in
the following sections.
The Font project
The first example project demonstrates the use of the IwGxFont API and can be seen
in the following screenshot. This example demonstrates how to use multiple fonts in
a project, preparing text for printing, and scaling a font up and down in size:
 
Search WWH ::




Custom Search