==== Compiling RTSimpleApp ==== This application tests audio, the particle system, text input and buttons. Flash version:
ERROR: Can't open interface/font_trajan.rtfont.
Can't load font 1
What's going on? We forgot to build resources, if you look in the bin directory there is no audio or interface directories. Unlike RTBareBones, you have to run a script to build the font(s) and convert the images (mostly .pngs) to our own .rttex format.
Use file explorer to navigate to
RTPack V1.3 by Seth A. Robinson. /h for help
Help and examples
RTPack (Compresses it as an rtpack without changing the name)
RTPack -make_font (Create a .rtfont)
More options/flags for making textures:
RTPack -4444 (Makes raw rgba 16 bit 4444 or 565 if no alpha .rttex)
RTPack -8888 (Creates raw rgba 32 bit .rttex, or 24 bit if no alpha
RTPack -8888 -ultra_compress 90 (Writes .rttex with good compression when there isn't alpha)
RTPack -pvrtc4 (Makes pvrtc .rttex - for PowerVR chipsets)
RTPack -pvrtc2 (Makes low quality pvrtc .rttex - for PowerVR chipsets)
More extra flags you can use with texture generation:
-mipmaps (Causes mipmaps to be generated)
-stretch (Stretches instead of pads to reach power of 2)
-force_square (forces textures to be square in addition to being power of 2)
-4444_if_not_square_or_too_big (1024 width or height and non square will use -4444)
-8888_if_not_square_or_too_big (1024 width or height and non square will use -8888)
-flipv (vertical flip, applies to textures only)
-force_alpha (force including the alpha channel, even if its not needed
-ultra_compress <0 to 100> (100 is best quality. only applied to things that DON'T use alpha)
-nopowerof2 (stops rtpack from adjusting images to be power of 2)
-o Writes final output as a normal image, useful for testing. Formats can be: png, jpg, or pvr
==== Landscape vs portrait ====
{{:proton:win_setup_4.png?|}}
(Um, actually this pic is out of date, the latest version shows a pic of Seth's kids' face, to illustrate loading a raw .jpg)
Assuming you built your resources right, and you're using the profile "iPhone", you'll see this. Uh oh, it's sideways because in App::Init() it has:
SetLockedLandscape(true); //we don't allow portrait mode for this game
This means it will force landscape mode. It will do a 180 flip if an iPhone is held upside down, but won't flip to portrait modes.
Before you sustain serious neck injury, change your profile to "iPhone Landscape".
It should now look more like this:
{{:proton:win_setup5.png?|}}
Demonstration of using the particle system, click (will be touch, when on a device) the screen to add an explosion.
==== Text input ====
{{:proton:win_setup6.png?|}}
A fake highscore screen to test text input. Click the text, then use your keyboard.
==== Music ====
It also has options to turn on and off ogg/mp3 background music.
==== Jpg support ====
It has the jpg files included and RT_JPG_SUPPORT defined, which allows Proton to load native .jpg files. RT_PNG_SUPPORT is used for png file support. (it's not enabled here)
==== Automatic scaling to fit the screen ====
It also demonstrates one more interesting thing - auto stretching. This app was designed for 320X480 "primary size" (before rotated to landscape) but will automatically adjust input and rendering to any screen size thanks to a single line of text in its App.cpp:
SetupFakePrimaryScreenSize(320,480);
To see the stretch in action, change the video mode in main.cpp "Nexus One". You should see...
{{:proton:win_setup7.png?|}}
You should see it properly stretches things to match the screen size.