The Sims FreePlay’s Way of Text Rendering

Gamers that plays the Sims FreePlay Android application will be familiar with the start up screen below:

sf01

Here it will show the constant message “LOADING…” and the varying message inside the blue box, which different each time when you start the application. Seems that this message is generated using some sort of random mechanism.

The actual string lies inside thesimsfreeplay_android.sb depending on the language setting of the device, and it is governed by STRING_LOADING_TICKER_XX records where XX denotes the sequence ranging from 00 to 21.

So, after the random module generates the sequence number, say 11, actually this is for “Earn big XP bonuses for reaching relationship milestones” above. This string will be retrieved and displayed on the GL Surface.

The text itself is rendered dynamically using glTexSubImage2D and it is placed on empty space of size 1024×64 texel inside existing texture channel. Each unique character to be rendered is generated on the existing texture memory as follows:

sf02

Because of the the texture memory is in inverted form, so to you can either flip the monitor to see the character or use the vertical rotation to view each of the character as follows:

sf03

Then, it is a matter of placing the right vertex position for each character to be rendered on to GL Surface.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: