You are on page 1of 41

Android Applications Page 1 of 3

Multimedia Fusion 2 and Android


Multimedia Fusion 2 allows you to build your application as an Android application.

What do you need to create an Android application ?

You need to download and install 2 external packages :

z You need to install the Java Development Kit, version 6. Note: JDK 7 is not fully compatible with
the Android SDK, especially for the signature of the applications, install JDK 6 instead. The first
time you build an Android application, Multimedia Fusion 2 will ask you for the pathname of the
JDK directory, select it in the folder selector. For example C:\Program Files (x86)
\Java\jdk1.6.0_43. You can later change it in the preferences if necessary. Note for 64-bit
machines : install at least the 32-bit version of the JDK, not only the 64-bit version. The 64-bit
version may cause a conflict with the SWF exporter.
z You need to install the Android SDK. Do not install the ADT Bundle. Click "Use an existing
IDE" and then download the "SDK Tools for Windows" (EXE installer). And then in the Android
SDK Manager install at least the Android 4.0 platform package (API #14). When you build your
first Android application Multimedia Fusion 2 will ask you for the pathname of the Android SDK
directory. You can change it at any time in the preferences of Multimedia Fusion 2.
Note: if you get building errors while building Android applications, open the preferences of
Multimedia Fusion 2, select the General tab, select Android in the Exporter list and verify the JDK
and SDK pathnames look like:
JDK: C:\Program Files (x86)\Java\jdk1.X.0_YY, or C:\Program Files\Java\jdk1.X.0_YY
SDK: SomePathName\AndroidSDK

And later when you want to release applications:

z You will need a certificate to sign your applications before being able to release them.
z If you want to publish applications on the Android Market, you will need to register a developer
account on https://market.android.com/publish/signup ($25).

Where to find documentation about Android development ?

Although Multimedia Fusion 2 makes it simple to develop an Android application, you will still need to
read Google's documentation, especially and the sections that explain how to publish your application,
test it, etc. The main page for Android development can be found at :
http://developer.android.com/index.html

Minimum requirements for Android applications created with Multimedia Fusion 2

Android applications created with Multimedia Fusion 2 require Android 2.2 or above, and Android
devices with a GPU (graphic processor). Applications created with Multimedia Fusion 2 will run on
Android devices without GPU but they will be very slow.

Thank you!

We would like to thank the following persons for their help in the finalization of this product. Thank you
for your help and suggestions !

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Building Android Applications Page 1 of 1

Building your Android Application


Building and testing Android applications

When you want to build your Android application, just select the Build command. Multimedia Fusion 2
will create a .APK file that you can install on your Android device or in the emulator.

If you want to build your application and test it directly to your Android device, connect your Android
device to your computer and then select the Build and Run command. Multimedia Fusion 2 will build
the .APK file and will install it on the device. Before that, you'll need to turn on USB Debugging in the
parameters of your Android device:

z Android 2.x and 3.x: this option is in Parameters / Applications / Development


z Android 4.0 and 4.1: this option is in Parameters / Developer Options
z Android 4.2: Developer Options is hidden by default. To display it, go to Parameters / About
device and then click 7 times on the build number
(http://developer.android.com/tools/device.html).

Note: if that doesn't work, you might need to install a special driver to your computer. Usually this
driver is available from the support web site of your device manufacturer.

If you want to test your application in the Android emulator, click the Emulator button in the Android
properties of the application, select one of the virtual devices and click Run. This will open the Android
emulator. If the list of virtual devices is empty, start the Android SDK Manager and create a new virtual
device in Tools / Manage AVDs. When the emulator is launched it takes some time to initialize. Wait
for the Home screen to appear and then click the Build & Run command in Multimedia Fusion 2. Your
application will be automatically installed and executed in the emulator. Note: this command may fail
the first time after the emulator was launched, in this case select the Build & Run command again. The
Android emulator is very slow though, you might want to test on a real device instead.

When development is over :

When you want to get serious, and publish your application :

z Select the "Android options" tab in the properties of your application


z Select the "Release mode" option
z Enter a valid key store path and a valid key name to sign your application
z Build it
z To publish your application, you will need to follow specific procedures, that can be found in the
Android developer documentation on http://developer.android.com

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Android Properties Page 1 of 5

Android specific properties


Application properties

These properties are located in the Android options tab on the right of the property explorer.

z Package name
The package name serves as unique identifier for your application. By default it's
com.yourcompany.yourapplication. It can be also org.yourorganization.yourapplication. Replace
yourcompany by the name of your company, and yourapplication by the name of your application.
z Minimum Android version
This option allows you to set the minimum version number of Android required to run your
application. Your application won't be executed on devices with a lower version of Android.
z Target Android version
This option allows you to set the target version number of Android. This target version is the main
version your application has been tested with and developed for (see documentation of
targetSdkVersion property in the Android SDK).
z Build & Run : install to ...
This option specifies where to install the .apk file to on the connected Android device or emulator
when you use the Build and Run command. You can install it either to the internal storage or to
the SD card.
z Emulator
Click this button to open the Emulator dialog box. This dialog box allows you to run the Android
emulator (use the Android SDK Manager to create virtual devices). When the Android emulator is
running, the Build & Run command will install and execute your application in the emulator.
Warning: the emulator may take a couple of minutes to display the Home screen, be patient.
Sometimes Build & Run fails the first time after the emulator was launched; in this case just try
again. The Build & Run command is also somewhat slower than the normal Build command, as
the application has to be transfered to the emulator (or device). Your application will appear in the
emulator as soon as the build progress bar disappears in Multimedia Fusion 2.
z Release mode
If this option is not selected, the .apk file will be signed with a debug certificate, so that you can
test it on a device. If you want to release your application you need to sign it with a valid
certificat. In this case select the Release mode option and enter a key store pathname and key
name.
z Certificate
{ Keystore name
Enter the pathname of the keystore that contains the key to sign your application. To
generate a keystore you can use the Keytool tool provided in the bin directory of the JDK.
This is a command line tool. For example, the following command line will generate the
"d:\great-release-key.keystore" file that contains the "great_key_name" key:

keytool -genkey -v -keystore d:\great-release-key.keystore -alias great_key_name -keyalg


RSA -keysize 2048 -validity 10000

Keytool asks you for your name, organization, country, the keystore password and key
password. More info here.
{ Keystore password
Enter the password of the keystore that you have entered when you've created it.
{ Key name

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Android Properties Page 2 of 5

Enter the name of the key that will be used to sign your application. See above for more
info.
{ Key password
Enter the password of the key you have entered when creating the keystore.
z Display mode
This option allows you to select either OpenGL ES 1.1 or OpenGL ES 2.0 as graphic renderer.
OpenGL ES 2.0 is often slower (it depends on the application though). Note: quick backdrop
objects with an ellipse shape require OpenGL ES 2.0.
z Screen rotation
This option allows you to select the orientation of your application window on the device.
z Display
This option allows you to choose the way your application is displayed on screen. 6 possibilities:

Center
No zooming will occur regardless of the device. The window will be
centered in the screen.

Expand/Adjust window size


No scaling will occur with this option, it will expand the window size to
fill the remainder of the screen so no black areas show.
Note that this will show more of your frame. The actual window size will
be exactly the same as the device resolution and the frame must be large
enough to support this.
Tip: You can resize your frame size at runtime at the start of the frame if
needed.

Fit inside with borders


This option will scale the game-contents to touch the inside of the screen
while maintaining the aspect ratio.
If your game window aspect ratio isn't the same as the device aspect ratio,
the contents will be centered and black borders will show.
This is the default option.

Fit inside and adjust window


This option will scale the game-contents to touch the inside of the screen
while maintaining the aspect ratio.
If your game window aspect ratio isn't the same as the device aspect ratio,
the game window will be expanded to fill the remaining of the screen so
no black borders show. Note that this will show more of your frame. This

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Android Things to know Page 2 of 4

was not required for any entity with a MP3-related gross revenue less than $100,000, but the terms
of this license may change, check them from time to time on mp3licensing.com).
z Other formats: the sound files that are not in OGG or MP3 format are converted to
uncompressed WAV format.

Storing data

You can write files to the data folder of the application, you do not need special permissions for
this, use the DataStorageDirectory$ expression of the Android object to retrieve the pathname of
this directory. The Android object also contains an expression to retrieve the pathname of the
external storage directory, typically the SD card. Note: if you want to write data to this external
storage directory you need to enable the WRITE_EXTERNAL_STORAGE permission in the
Android properties of your application.

Embedded Files

If you want to pass initialization files to objects like Active Picture, INI, List Box, etc, just add
them to the Binary Data tab in the Data Elements editor. For example, if you want to display
landscape.png with an Active Picture object, add this file to the Binary Data tab in the Data
Element editor and load it as you would do it on PC in the Active Picture object.
z Note 1: on Android the directory pathname of the files in the Binary Data tab is ignored. If 2 files
have the sane name only the first one will be used.
z Note 2: in the Android runtime, if you initialize the INI object with a predefined INI file stored in
the Binary Data tab, the INI file will be stored in the folder of the application on the Android
device only if it doesn't exist already. So, if you want to change the content of the INI file you
pass in the Binary Data tab, don't forget to erase the data of your application in the Android
parameters of your device.
z Note 3: if you use the Unicode version of Multimedia Fusion 2 and want to use Unicode
characters in text files you pass to the List Box, Combo Box or INI objects via the Binary Data
tab, make sure these files are in UTF-8 format (if you are not sure, edit them with Notepad, select
Save As and set the character set option in the file selector to UTF-8). Also the INI file should
start with an empty line.

Memory considerations

Android devices are portable devices. As such, the amount of usable memory (RAM, not to be
confused with Flash memory where the files are stored) is limited.

The conclusion is that if you want your application to work on an Android device, you have to be
very careful about the size of your graphics and sounds. The next section will give you tips to
reduce the memory imprint of your graphics.

How to find out exactly how much memory your application takes?

The amount of memory used by an application is shown in the debugger window (top left of the
screen) when you launch your application in Multimedia Fusion 2. The memory displayed is
evaluated for a PC application and does not reflect the amount of RAM really taken by your
application under Android.

How to save memory for your graphics?

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Android Things to know Page 3 of 4

Alpha-channels
Alpha-channels look awesome and give a visually pleasing effect but they will slow down your
game if you overuse them, just as they do in the PC runtime (only more).
An image with an alpha-channel takes 33% more memory and space than an image without and it
takes more power and time to render them.

Workaround:
Does your graphic really need the alpha-channel? Does the background underneath it ever
change? If not you could probably "bake" the alpha-channel effect into the image itself so that the
shadow is just part of the picture.

Huge pictures
Many are often tempted to import really large pictures into the game where it will only show very
little of that picture at one time. Some good advice is to break it up into smaller parts so that fewer
of them are shown at one time. Remember that any image you have in your game has to fit inside
their texture. In a sample game there was a 960x480 sized background image on a frame. This
picture alone had to fit into a 1024x512 texture taking up a huge amount of memory. What was
even worse was that it had an alpha-channel even though no pixel in it was transparent. Second,
the same frame had two different huge animations sized 957x158 (each of them contained 17
frames). This already takes up 2*17 * 1024*256 * 3 = 26738688 bytes = 25.5 MB of RAM which
is way above what Android likes. That was even without the rest of the graphics and the huge
background image we talked about before.

Workaround:
Most graphics don't need 100% crispness and quality. It will only take 1/4th of the previous
memory usage if you cut your image size in half and then at runtime scale it to 2.0. It will also run
much faster as it utilizes the graphics card RAM cache much better.

Tip:
Crop your images, remove any useless empty space around them. Some developers tend to use a
single frame size for an entire animation with huge transparent parts in some images. It's probably
better at design time, but at runtime it results in a loss of time and space.

Tip:
Try to make your graphics of a size close a power-of-two. It will waste less precious memory.
A power-of-two size is one of the following: 8,16,32,64,128,256,512,1024 Images less than 8x8
pixels will be stored in a 8x8 texture as they cannot be smaller than that.
You can easily use different sizes for your width and height, they don't have to be equal.

Tip:
Be sure to set the "Image compression" property to "Color reduction" either globally for all
objects in the App Android properties or per object, as often as you can. In many cases, it will
consume half the memory it did before.
Take for example the big background image mentioned above. It wasted 2 MB of texture memory.
With color compression and no alpha channel it will only take 1 MB. If it was cropped to only fill
out the resolution of the iPhone device it would only take 30 KB. The animations mentioned
before that took 25 MB of RAM can with color compression and half the resolution only take:
2*17 * 512*128 * 2 = 4456448 bytes = 4.25 MB! That is a huge difference.

Single color graphic


This is kinda an extension to the previous pitfall. We have often seen in the sample games we

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Android Things to know Page 4 of 4

have debugged some big actives (typical white) that are meant to cover the entire screen and fade
to transparent. People need to realize that even though they are pure white (or whatever color)
they are still stored in memory uncompressed at runtime and waste just as much memory as if it
was a pretty picture. If you need those fade-effects, you can scale a small active to fit the screen at
runtime and gradually alter it's semi-transparency.

Speed considerations

Overuse of "text" counters/score and strings Although it may not be a big issue, it can hurt the
performance of your game if you use too many objects that draw text. If the text doesn't change, it
should not be a performance problem, but if you update your string/score/counters often you will
get a performance problem.

Workaround:
- Only use text whenever you know it will not change often (like every frame).
- Use bitmap counters/scores instead of text counters/scores. You can much better control the
visual style of your objects and there is nearly no performance penalty.

Unnecessary effects
We have seen other games almost ready for release where effects are unnecessarily used often.
Having a big background covering the screen and setting it to either transparent or ADD so that it
will be added to some gradient behind it, will only make your game slower and consume more
power. Instead, make your graphics as they should look at runtime and then use them like that.
Effects are only meant for places where you cannot modify the original image to look like it
should at edit time. For example, if you want a grayscale background from a picture, make it
grayscale before you import it into Multimedia Fusion 2. You simply don't put the monochrome
effect on it and forget about it

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\Andr... 5/19/2013
Multimedia Fusion 2HTML5 applications and games Page 1 of 3

HTML5 Applications and games


Multimedia Fusion 2 allows you to build your application as a HTML5 project that can be directly
uploaded to a web server. An HTML5 application will work on modern web browsers, without any
modification. This is the perfect modern way to distribute your game or application.

Advantages of HTML5 applications

z The same file will work on any modern web browser, being on a PC, Mac, Linux machines or
phone or tablet.
z Small size of the application : the code of the runtime is shrank to a minimal size of under 300Kb,
which is very small for the speed of today's networks. Furthermore, once loaded, the code of the
runtime stays in the browser's cache and is instantly loaded the next time.
z Applications run fast : on most PCs and on more and more tablets or phones, Javascript and
HTML5 run faster and faster. You will be able to display a large number of objects and have a
complex event structure : the HTML5 runtime will cope with it.
z Secure for the users : your application runs in a sandbox, a restricted area from where it is
impossible to harm the user's machine.

Advantages of Multimedia Fusion 2 for creating HTML5 applications

z No need to program in Javascript. You can use Multimedia Fusion 2 visual programming system
to create amazing games in a much simpler and faster way.
z The browsers make use of hardware acceleration as soon as it is available, allowing you to display
a huge number of objects.
z Your application can contain a preloader to make people wait while your application is loading.
z The great majority of the conditions, actions and expressions available for the Windows runtime
are available in the HTML5 runtime. A large number of extensions has been ported and the
number is increasing on a regular basis.
z The Build & Run option of Multimedia Fusion 2 allows you to instantly test your application in its
final state, within a browser, thanks to our internal local Web server.

Thank you!

We would like to thank the following persons for their help in the finalization of this product. Thank you
for your help and suggestions !

z Hiroshi Ashida
z Matt Esch
z Federico Aliprandi
z Patrice Cervelin
z Joseph Hatcher
z Raymond Emmonot
z Logan Apple
z Fernando Vivolo
z Jose Rafael Marcano
z Daniel Hjelm
z Jens van Dijk
z Ross Dawson
z RockyRaccoon

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Building HTML5 projects Page 1 of 2

Building your application as HTML5 project


How to build an HTML5 project

z You are working on your application


You should choose the "HTML5 Development" build type. This option will create a folder with
your application and all the code to make it work. It includes all the available extensions at the
time of build : you will be able to work on your application and add as many extensions as you
want under Multimedia Fusion 2, and it will still work fine.
The best feature of this kind of construction, is the "Build & Run" feature. This option is available
in the tool bar on the top of Multimedia Fusion 2 window. Click this button, and Multimedia
Fusion 2 will build your application instantly, launch an internal local web-server and open your
default web-browser on the game you just built. The delay before actually seing your application
work in the browser is very short, usually under one second. Note: building the mosaics of images
may take some time for complex applications. If this is the case, we suggest you to un-check the
"Group images in mosaic files" property in the HTML5 properties of the application : the images
of your application will be saved as individual files, faster.
The "HTML5 Development" build type should only be used with the "Build & run" option (you
will get an error if you try to launch such an application from a web-server. "HTML5 Final
Project" is available to you to create applications to upload to a server.
z You want to release your application
Choose the "HTML5 Final Project" build type : Multimedia Fusion 2 will save the runtime code
limited to the extensions only used in your application and compile the code. The runtime code
will be smaller, highly compressed and unreadable.
This option is the one to use if you want to test your application on a web-server. As the runtime
code is compressed, uploading the files to the server will also be a lot faster.

What does the Build HTML5 option save?

When you build your game as a HTML5 project, Multimedia Fusion 2 :

z Creates a folder with the name of the project in the location you indicated
z Creates a "src" folder in which it saves the Javascript code of the HTML5 runtime (the name of
this folder can be modified in the HTML5 properties of the application).
The "HTML5 Development" build type saves a full, complete and readable Javascript source
code, as multiple .js files. This solution should be used during developement as it is a lot faster
(compiling the code takes a few seconds), thus enabling you to test your application much faster.
The "HTML5 Final project" option saves a compressed version of the runtime code, in one .js file.
z Saves your application as "name_of_application.cch" in a "resources" folder. You can change the
name of this folder in the HTML5 properties of the application.
z The images used in your application are also saved in the "resources" folder. The images are saved
as PNG files. If the "Group images in mosaic files" property (available in the HTML5 properties
of the application) is checked, the graphics of your application will be pasted in larger images,
reducing the time necessary to load your application from a server. They are saved as individual
files if the property is not checked (as said before, unchecking this option may be faster during
development).
z The sounds are saved as "OGG" and "M4A", "OGG" and "MP3", or "OGG" and "WAV" files,
depending on the operating system you use, in the resource folder. The goal being to ensure that
the sounds work on every available browsers.
If your operating system is Windows 7 or 8, sounds will be saved in "OGG" and "M4A" format. If

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Building HTML5 projects Page 2 of 2

you use an older version of Windows, we recommend you to download and install the LAME
MP3 encoder (lame_enc.dll) in the Multimedia Fusion 2 Data\Runtime directory. If lame_enc.dll
is in the Multimedia Fusion 2 Data\Runtime directory and you use Windows 2000, XP, or Vista,
Multimedia Fusion 2 will save the sounds in "OGG" and "MP3" format. Search for lame_enc.dll
with your Internet search engine, you'll easily find it. If you do not use Windows 7 or 8 and
lame_enc.dll is not in your Data\Runtime directory, Multimedia Fusion 2 will save the files in
"OGG" and "WAV" format and sounds might not work in Internet Explorer.
z Saves a "html" file allowing you to launch your application in a click. The html file produced by a
final build can be copied to your own server. You can prevent Multimedia Fusion 2 from saving
this file (this might become handy at the end of development), however please note that the Build
& Run option will launch the browser to this file : this option will not work if it is not present in
the project folder.

How to run your HTML5 project.

Modern browsers do not accept loading of data from the local file system. The Multimedia Fusion 2
HTML5 runtime needs to load the "CCH" file in order to understand and play the application. As a
result, you cannot simply drag & drop the html file of your project onto a web browser (please note that
certain versions of Firefox will accept this).
The best way to see your application working in a web browser is to use the "Build & Run" option of
Multimedia Fusion 2. This option will first build your application in the destination folder, then start an
internal local web-server (totally transparent to you), and launch the default web browser pointing to
your application.
If you want to test your application on multiple web-browsers, first use the "Build & Run" option to start
your application in your default web-browser, copy the link that is displayed in it, then paste it in the
browser of your choice. The local web-server will remain active until you close Multimedia Fusion 2.
You can keep the browser open and rebuild your application in the same folder (using the File / Build
option from the menu, or the Build command in the context menu of the application) : you will only
have to refresh the page in the browser (with F5) to see the changes.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Properties Page 1 of 2

HTML5 properties
HTML5 applications have a number of specific properties, allowing you to tweak the way they work.

Application properties
Generate HTML file
If checked, Multimedia Fusion 2 will save an html file (named after the name of your application) in the
destination folder, so that you can load and launch your application. This html file is essential for the
Build & Run option to work. This html file shows you a way to embed and display a Multimedia Fusion
2 application in a web page, and is fully commented.
You may want to create your own version of this file. If you do so, uncheck this property, and it will not
be erased on the next build.

Group images in mosaic files


If checked, all the different images that your application contains will be grouped in bigger images,
called mosaics. This feature dramatically reduces the time necessary to load the graphics of your
application.
If your application contains a lot of images, the process of creating the mosaics can take some time. You
may want to disable this property if the Build & Run option becomes too slow : all the images will be
saved as individual files, and the building process will be faster. Do not forget to check this property
again before releasing your application.

Keep resources between frames


If checked, Multimedia Fusion 2 will not release the images and sounds between each frame : they will
not need to be reloaded the next time your application plays the same frame, thus accelerating the time
necessary to enter the frame.
Do not use this option if your application has to run on mobile devices, like tablets or phones, as this
kind of device does not have as much memory as PCs.

Run even if not focus


If unchecked, your application will be paused as soon as the browser window looses the focus. If
checked, your application will keep on working if the browser window looses the focus.

Do not mute samples when application loses focus


This property is located in the "Runtime options" page of the application properties. If the previous
property is checked (the application will run even if it does not have the input focus), it indicates
whether or not Multimedia Fusion 2 will stop the sounds when the application loses the focus. You can,
for example, keep on playing the sounds with the application paused.

Allow offline
Allows the generation of an "appcache" file, saved beside the html file, that allows your application to
work on the user's computer even if his machine is not connected to the Internet. All the sounds, images
and data are cached in the browser cache file when the user plays your application for the first time, and
will be used if the machine is not connected.
We suggest you to enable this option only at the end of the development, when your game is complete.
Note that, in order for this option to work, the mime type "text/cache-manifest" must be defined on your
server for the files ending by ".appcache".

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Properties Page 2 of 2

Media folder
Contains the directory where all the resources of your application will be saved when you build your
project. This property can be empty, in this case all the data will be stored at the root of the project.
Changing this property will automatically change the code contained in the html file Multimedia Fusion
2 generates. Please note that if you decide to change the directory, you will have to manually erase the
previous directory in the build project folder.

Source folder
Contains the directory where the Javascript source code allowing your application to run is saved. The
property can be empty, in this case the Javascript code will be saved at the root of the project's folder.
The same remark as above applies.

Joystick images
This property contains the images of the touch joystick. Refer to the Joystick property below for more
information.

Frame properties
Each frame also contains some HTML5-specific properties.

Display preloader.
If a preloader has been defined for your application, this property indicates whether or not to display it
for this frame. For a preloader to be displayed, the next two things must be satisfied : 1. The preloader
must be defined in the application properties, 2. The display preloader property must be selected.

Joystick
Multimedia Fusion 2 can, when your application is used on a mobile device that has no keyboard,
replace the key with a virtual joystick, or a joystick piloted by the accelerometers. The choice is made in
a combo box :

z None
No joystick is displayed.
z Touch joystick
A virtual joystick is displayed on the left or right of the screen.
z Accelerometer joystick
The joystick is controlled by the accelerometers of the device.
z Controlled by an extension
You have to drop the "Joystick control" extension on your frame, and use this extension to display
or not the joystick.

Fire 1 button
Displays the first joystick button.

Fire 2 button
Displays the second joystick button.

left handed
Reverses the position of the joystick and buttons for left-handed users.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Differences with PC stand-alone applications Page 1 of 2

Differences between HTML5 and Windows


applications
The HTML5 file exporter tries to make your HTML5 application work as close as possible as your
Windows (stand-alone) application that you can see in action when you run it with the "Run
Application" or "Run Frame" commands, but there are some differences between HTML5 and EXE
applications. These differences are usually minor, but they can affect the way your program works. This
is the reason why we highly recommend you to use the "Build & Run" option of Multimedia Fusion 2,
as it will show your application directly inside a web-browser.

Here is the list of the main differences.

z Background collision mask


The way the background collision mask is handled is very different compared with the Windows
runtime. In HTML5 applications, when you have a "No obstacle" object in front of an "Obstacle"
or "Platform" background object, the "No obstacle" object will NOT have any effect on the
collisions. Basically, the objects above it WILL have a collision detected, even if your topmost
object is "No collision". The same limitation also occurs when you paste a "No obstacle" object in
the background : it will not have any effect on the collisions.
z String object, display of the string. In the Windows runtime, the text of a string object can go
over the vertical size of the object. In HTML5 applications, the text is clipped to the size of the
object : you have to set the height of the String object large enough to contain all the text of the
object.
z String object, text height calculation
Javascript calculates the height of a string of text differently than Windows. The result is that the
height of the calculated text is higher than in Windows stand-alone applications. Therefore,
vertically centered String objects will be displayed a little lower than in the Windows runtime.
You will have to take this into account when positioning String objects in the frame.
z Many properties of the application and the frame available in Windows are not applicable to
HTML5 applications. These properties will be grayed out when you turn your Windows
application into a HTML5 File (by changing the Build type in the application's properties). After
being grayed out, even if they are checked, they will have no effect. Example of properties
without effect :
{ "Keep display from previous frame".
{ "Window style properties".
{ "Window menu".
{ "Change resolution mode".
{ "Machine Independent Speed".
{ "etc.".
z Keyboard and mouse events do not occur at exactly the same time in the game loop. This might
cause some problems in your application (like objects flashing when you set their position
responding to a mouse click). Also right mouse clicks can't be intercepted.
z Due to internal encoding of floating point numbers, comparison between floating point
numbers may never be true. For example "Counter = 1.23" may not be true as the counter might
be at 1.229999999. The solution here is to make a greater/smaller comparison with two
conditions. Example "Counter>1.28" and "Counter<1.31". Note: this is true with the Windows
runtime too! However calculations are more precise in the Windows runtime, so this problem may
occur less often.
z Complex calculations involing mixed integers and floating point numbers may (rarely) return a

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Differences with PC stand-alone applications Page 2 of 2

result that is different (but approaching) from the Windows version as the calculation process is
different in Javascript and in C++. Solution: put parentheses surrounding the different steps of the
expressions to isolate the floating point and integer values.
z Mouse pointer.Some browers do not allow the retrieval of mouse coordinates out of the
application's window area. This means that when the mouse cursor goes out of the frame, the last
known coordinates will be the ones just before the mouse left the area. The mouse will then stay
static until it comes back again in the frame.
z There might be a display priority difference between pasted objects and background objects on
the same frame.
z Layers with unlimited scrolling. You must set the Wrap property of the first layer to ON so that
the color of the background of the frame is displayed throughout the scrolling.
z Files. Javascript cannot write or read any file on the machine of the user. It can save and read data
in a specific browser-dependant folder, and read data directly from the web server where the
application is located.
The Edit, List, Combo and Ini objects first try to load the data from a previous data section saved
by the application. If they cannot find it, they will try to load it from the binary file section of the
application. If the file cannot be loaded from there, they will try to load the file from the web
server (the file should be located beside the html file).
Unlike the Windows runtime, the HTML5 runtime only takes the name and extension of the file
into account when retrieving the file : the path and drive are ignored.
Example : an INI object can have a full pathname (linking beside the Windows "MFA" file), this
pathname will be ignored by the HTML5 runtime, and the name and extension of the file will only
be used to save and load the INI data.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Various considerations Page 1 of 2

Various considerations about HTML5 project


Multimedia Fusion 2 This page contains different chunks of information about the Multimedia Fusion 2
HTML5 exporter.

Mouse-driven movement
The mouse movement in HTML5 games is different from the normal mouse movement. The object is
positionned just under the hidden mouse pointer. This implies that the mouse pointer must be above the
play area for the object to move.

How to keep your application small.


Despite the speed of nowadays Internet connections, it is always good to keep the size of your
application to a minimum. Here are a few hints to keep the size down:

z Do not use large backdrop images, but repeat smaller backdrop objects. A large image can be
quite big, esspecially if it is complex. Even if the images are highly compressed, a big image will
increase the size of the images saved along with your HTML5 application. Most of the time, the
background of a game can be created by repeating smaller elements at different locations. Also do
not forget the Motif option in the Quick Backdrop object.
z Use scaling and rotation. Active objects can be rotated and scaled. You should use this feature
for as many objects as possible, thus reducing the amount of graphics in your file. Basically, you
just create the animations of your object in the right direction, and then check the "Automatic
rotations" property in the object's runtime properties. Your object will be automatically rotated
depending on the direction of the movement.
A drawback of the rotation and scaling is speed. If your rotated object is involved in collision
detections, a rotated and scaled mask must be created in memory to allow the collision system to
work. Creating this mask can take some time, esspecially for big objects. Only experimentation
will tell you if the process is not too long for your game, but basically the smaller the faster.

Sound formats
Multimedia Fusion 2 does its best to save the sounds so that they work on all the available browsers. The
sounds are saved in two different formats.

z Your system is Windows 7 or 8


The sounds will be saved as "OGG" and "M4A" formats, ensuring a good sound experience on all
the browsers available today.
z Your system is Windows XP, 2000, Vista
We recommend you to download and install the LAME MP3 encoder (lame_enc.dll) in the
Multimedia Fusion 2 Data\Runtime directory. If lame_enc.dll is in the Multimedia Fusion 2
Data\Runtime directory and you use Windows 2000, XP, or Vista, Multimedia Fusion 2 will save
the sounds in "OGG" and "MP3" format. Search for lame_enc.dll with your Internet search
engine, you'll easily find it. If lame_enc.dll is not in your Data\Runtime directory and you use
Windows Vista, XP or 2000, Multimedia Fusion 2 will save the files in "OGG" and "WAV"
format and the sounds might not work in Internet Explorer.

Sounds on iOS
On iPhone, iPod and iPad (and certainly any new Apple portable platform to come), Apple restricts the
way sounds are played on the device.
An iOS device will not play any sound unless the sound has been created by a user interaction
(understand a touch on the screen). Multimedia Fusion 2 does its best to cope with this restriction, and

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
Various considerations Page 2 of 2

uses a special touch detector that will start the sounds after the first touch on the screen.
The consequence is that your iOS HTML5 application will not play any sound until you touch the
screen for the first time. After the first touch, the sound will be loaded as best as possible, and will start
playing after a moment. Once a sound is loaded, it will play flawlessly on the device, but do not expect
sounds to play immediately after the first touch : there will be a delay before the sound is played for the
first time.

Joystick
The Multimedia Fusion 2 Joystick object is by default affected to the arrow keys, SHIFT and
CONTROL. These keys will be active if your application is run on a computer with a keyboard.
Multimedia Fusion 2 allows you to display a virtual joystick to be used on a mobile device. You only
have to activate the "Virtual joystick" property in the properties of the frame, and this graphical joystick
will be displayed on a mobile device.

Switching to full screen


To project the user's machine, Web browsers impose restrictions to full screen : a Javascript application
can only switch to full screen as a direct response from the user (a click). As a consequence, the
"Change resolution" property has been disabled in the Application properties.
You must, in order to switch to full screen, insert the Storyboard / Set full screen action in a event
beginning by a Mouse click condition.
You can, however, use the "Resize display to fill window size" property (in the Application
properties) : your application will fill the entiere browser window, and appear full screen on tablets and
telephones.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\HTM... 5/19/2013
iOS Applications Page 1 of 1

Multimedia Fusion 2 and iOS


Multimedia Fusion 2 allows you to build your application as an iOS application (iPhone, iPod or iPad) and
distribute it on the App Store.

What do you need to create an iOS application ?

z A Macintosh computer running at least OS X Snow Leopard.


z Being registered as an iOS developper with Apple ($99 per year). Note: you can register a simple
Developer account (free) and test your applications in the iPhone simulator, then register as iOS Developer
($99 per year) when you want to test your applications on a real device or distribute them.
z Xcode and the latest version of iOS 4 SDK installed on the Mac.
z Some kind of connection between your PC and your Mac, either a Network or FTP connection, so that you
can transfer files between the two machines. If you do not have a network or a FTP connection, you can use
services like Dropbox (www.dropbox.com).
z To test on a real device, you need an iPhone, iPod Touch or iPad running iOS4. Complete the registration
process so that you get a profile-provisionning file and install this provisionning profile on the device.

Where to find documentation about iOS development ?

Although Multimedia Fusion 2 makes it simple to develop an iOS application, you will still need to read Apple's
documentation, specially the sections on how to get a provisioning profile so that your application can work on
your device, distribute it to your beta testers, submit your application to Apple and publish it. The main page for
iOS development can be found at :

http://developer.apple.com/iphone/library/navigation/index.html

Thank you!

We would like to thank the following beta testers for their help in the finalization of this product:

AndyH
BHGames
Chris Carson
DavidN
Fanotherpg
Giovanni Cardona
Koji Kabuto
Jason Darby
Jeff Vance
Mario Russo
Mokhtar
Netninja
Nifflas
UrbanMonk
Pharanygitis
Renatos
RhysD
SToP_GAP
Stu_Ovine

Thank you for your help and suggestions !

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
Building iOS Applications Page 1 of 1

Building your iOS Application


What to do you to get your application on the Mac for the first time ?

z Create your application or game on your PC, making sure that "iOS Xcode project" is selected in the
Build types property of the application. Test the application on the PC.
z Choose "File / Build / Application", and enter the name of your zipped Xcode project (should be the
same name as the application plus the ZIP extension). Multimedia Fusion 2 saves a ZIP file
containing a complete Xcode project ready to compile.
z Transfer the ZIP file to your Mac
z Unzip the ZIP file on your Mac by simply double clicking on it. You now have a complete Xcode
project folder
z Start Xcode
z Open the "XXX.xcodeproj" file in Xcode, where XXX is the name of your application.
z For the first build, select "Simulator" in the top-left combo box. Note: if "Base SDK missing" is
displayed in the combo box, open the project settings and change the Base SDK option.
z Click on "Build and run". After a little time, the emulator should start and display your application.

What to do during development :

Now that you have a working Xcode project on your Mac, there is no need to transfer the entire project
each time want to test your application. Multimedia Fusion 2 provides a much simpler method.

z Go in the Application properties on the PC, "Build type", and select "iOS application (cci)"
z Build your application as usually, but enter "Application.cci" as file name. This will save a file
called "Application.cci"
z Transfer "Application.cci" to the Mac
z On the Mac, copy this file to the root of your Xcode folder
z Then in Xcode, recompile the project. The new application is used.

When development is over :

When you want to get serious and publish your application, you will need a final version of your Xcode
project.

z Go in the Application properties on the PC, "Build type" and select "iOS final Xcode project"
z Build your application, entering the name of an Xcode zipped folder
z Transfer the ZIP file to the Mac
z Double click on the ZIP
z Open the file "XXX.xcodeproj" in Xcode, where XXX is the name of your application
z Build and run
z To publish your application, you will need to follow Apple's procedures, which can be found in the
developer documentation

Note : what is the difference between the "iOS Xcode project" and the "iOS final Xcode project"? The
difference resides in the extensions. The development project contains all the available extensions, and
therefore works if you add a new extension to your application, allowing you to copy the cci file directly
to the folder of the Xcode project. The final project only contains the necessary extensions, making the file
size smaller. It will not operate properly if you add a new extension without rebuilding the entire project.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Properties Page 1 of 4

iOS specific properties


When you choose one of the iOS build types in the Application properties, new properties appear. Here
is a list of the new properties.

Application properties

These properties are located in an iOS folder on the right of the property explorer.

z Bundle identifier
This property contains the bundle identifier of your application. It is usually in the form of
"com.yourcompany.ApplicationName" if you follow Apple's recommendation. When you create
your provisioning profile, we strongly suggest that you enter a name like "com.yourcompany.*".
The ‘*’ at the end means the provisioning profile works for more than one application.
The bundle identifier is required to test your application on the device connected to your Mac and
to publish your application on the App Store. Please read Apple's documentation.
z Bundle version
This property contains the version number of your application. It should be in the form of "1.0".
You can also specify sub-version numbers like "1.1.2.3". Please note that when publishing your
application on iTunes, Apple just takes into account the short version number ("1.0").
z Targeted device
This property allows you to choose on which iOS device your application will run. "iPhone"
allows it to run on iPhone and iPod Touch, "iPad" on iPad 1 and 2 (and future versions), and
"iPhone / iPad" on all these devices.
z Architecture
This property allows you to specify the devices Xcode will compile the code for. If your
application is supposed to run on fourth generation devices or above only, or iPads, select
"Default Architectures". If your application should also run on older devices (second and third
generation iPhones), select "All architectures".
z Display status line
Uncheck this property to hide the iOS status line. Note that keeping the status line will hide a
portion of your application.
z Screen orientation
This property allows you to fix the orientation of the screen when your application runs.
z Image compression
The graphic memory on iOS device is limited. The image compression option allows you to
reduce the size of the graphics of your application in memory. Two options are available : None
and Color Compression. If you select "Color Compression", the images are automatically
converted to either 65536 colors (opaque images), 32768 colors (unique transparent color) or 4096
colors (alpha channel with multiple transparency levels).This option will divide the size of your
images by two. This can reduce the quality of the images, but you can choose to ignore this option
for specific objects; refer to the object properties below.
z Multitask
iOS 4 is a multitasking environment. When you use an application and press the HOME button on
the device, the application goes into sleep mode and is taken to the background. You can revive it
by clicking on it in the application list. If you do not want your application to be multitask,
uncheck this property and your application will be discarded when the user presses HOME. Note:
Apple really prefers multitask applications!
z Application icon (iPhone)
This property contains the icon of your application if it is built as an iPhone or iPhone/iPad

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Properties Page 2 of 4

application. It is a 114x144 image that will be used to display your application on the device.
Click on EDIT to modify it. Please note that the device will automatically add the reflection
effect, so you do not need to add such an effect (or your application will be rejected by Apple).
Your icon must be "flat".
z Application icon (iPad)
This property contains the icon of your application if it is build as an iPad or iPhone/iPad
application. It is a 72x72 image, that will be used to display your application on the device. Click
on EDIT to modify it. Same remark about the reflection effect applies.
z Launch image (iPhone)
This property contains the image to be displayed on the device while the application is loading if
it is compiled for iPhone or iPhone/iPad. It should be a title picture or the representation of the
first frame of your application. This is a 640x960 picture.
z Launch image (iPad)
This property contains the image to be displayed on the device while the application is loading if
it is compiled for iPad or iPhone/iPad. This is a 768x1004 picture.
z iTunes artwork
This property contains the image to be used in iTunes. It is a 512x512 image and should be the
same as the application icon (otherwise Apple will reject your application). Also, you should not
add any reflection effect.
z Joystick images
This property contains the images of the touch joystick. Refer to the Joystick property below for
more information.
z Display
This option allows you to choose the way your application is displayed on screen. 6 possibilities:

Center
No zooming will occur regardless of the device. The window will be
centered in the screen. If you have an iPhone 3GS resolution app, it will
look small on the iPad or iPhone with retina screens.

Expand/Adjust window size


No scaling will occur with this option, it will expand the window size to
fill the remainder of the screen so no black areas show.
Note that this will show more of your frame. The actual window size will
be exactly the same as the device resolution and the frame must be large
enough to support this:
These are the minimum sizes for your frame:
Device Minimum frame size
iPhone 3 & 3GS 320 x 480
iPhone 4 & 4S 640 x 960
iPhone 5 1136 x 640
iPad 1 & 2 768 x 1024
iPad 3 2048 x 1536
The width/height is swapped in landscape mode.
Tip: You can resize your frame size at runtime at the start of the frame if

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Properties Page 3 of 4

needed.

Fit inside with borders


This option will scale the game-contents to touch the inside of the screen
while maintaining the aspect ratio.
If your game window aspect ratio isn't the same as the device aspect ratio,
the contents will be centered and black borders will show.
This is the default option.

Fit inside and adjust window


This option will scale the game-contents to touch the inside of the screen
while maintaining the aspect ratio.
If your game window aspect ratio isn't the same as the device aspect ratio,
the game window will be expanded to fill the remaining of the screen so
no black borders show. Note that this will show more of your frame. This
requires that your frame is large enough to display the new area.

Fit outside
This will scale the game to fill the entire screen so that no black borders
show.
This will crop the remaining areas that go outside the screen away.

Stretch
Ignores any aspect ratio and just stretches the contents to fill the entire
display.
Graphics can look squashed if the aspect ratios of the game window and
the device don't match.

Frame properties

These properties are located in an iOS folder on the right of the property explorer.

z Touch mode

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Properties Page 4 of 4

Choose between "Single touch" and "Multi touch". If single touch is selected, only one finger (the
first one on the screen) will be detected. If you use the "Multiple Touch" object to detect mutliple
touches, you should select "Multi touch". Note the latter option requires more battery power, so
you should only use it when necessary.
The first touches (or single touches) are automatically mapped to the mouse pointer coordinate in
Multimedia Fusion 2, so you can create applications using the mouse with no problem.
z Disable idle timer
If your game does not not induce the user to touch the screen (use of accelerometers, or static
frames), the device might automatically go into energy saving mode after a period of time by
reducing the lighting of the screen and then shutting off.
You can prevent this from happening by checking this property. If checked, the device will remain
ON at full power for the duration of the frame. Use this property with caution as it might drain the
user's battery!
z iPhone Joystick / Device
Multimedia Fusion 2 allows you to emulate a joystick in the iOS application. With this you can
use Multimedia Fusion 2 default movements, controlled by a joystick on the device. This combo
box offers you the choice of joysticks :
{ None
No joystick is displayed. Only use this property when your frame does not contain any
joystick-controlled movement
{ Touch joystick
The joystick is emulated on the bottom of the screen of the device. You can control the
movements using your fingers. The joystick consists of a paddle button and two fire
buttons.
{ Accelerometers
The movements are controlled by the position of the device. Two fire buttons are available
on the screen.
{ Controlled by an extension
Choose this property to manually start or stop the joystick using the Joystick Control object.
Note this object will not work if the property is not set to this value.
z Fire 1 button
Check this box if you want the Fire 1 button to be displayed
z Fire 2 button
Check this box if you want the Fire 2 button to be displayed.
z Left handed
Check this box to have the paddle on the right and the fire buttons on the left of the screen.

Object properties

These properties are located in an iOS folder on the right of the property explorer.

z Image compression
This option allows you to force the compression mode of the objects images. 3 options :
{ Default : the Image Compression mode of the application will be used. Refer to the
properties of the application above for more info.
{ None : the images of the object won't be compressed even if the Image Compression
property of the application is set to Color Reduction.
{ Color Reduction : the images of the object will be compressed even if the Image
Compression property of the application is set to None.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Differences Page 1 of 2

Differences between iOS and PC applications


Sounds

Multimedia Fusion 2 offers you two ways of playing sounds.

z The first one, called "AudioPlayer", is suitable for long sounds, like background music. Its main
advantage is that it does not store the entire sound in memory prior to playing, thus taking less
space. Its disavantage is that it takes some processing power when the sound is started, slowing
down the application. This time lag makes it a bad choice for playing in-game sounds.
z The second one, called "OpenAL", is suitable for short sounds. The sound must be stored in
memory prior to playing, but it does not take any processing power when the sound is started.
OpenAL is a good choice for short sounds in the middle of the game.

When you use a "Play sample" action in iOS mode, there is a new check box at your disposal, named
"Play with AudioPlayer". This check box has three states :

z Unchecked : the sound will be played using OpenAL


z Checked : the sound will be played using AudioPlayer
z Undetermined : Multimedia Fusion 2 looks at the duration of the sound. If it is less than 15
seconds, then it is played with OpenAL. If it is more than 15 seconds, it is played with
AudioLayer. This is the automatic mode.

The default setting is automatic mode.


Basically, you should check the box only for background music, or leave it undetermined. Please note
that the Set Sample Position action and the Get Sample Position expression work with AudioPlayer, but
not with OpenAL, and that the Set Sample Frequency action works only with OpenAL.

MP3: iOS supports MP3 sounds. The iPhone exporter for Multimedia Fusion 2 adds an MP3 filter to
allow you to insert MP3 sounds into your applications. Be careful though as the iPhone/iPad/iPod have a
single MP3 hardware decoder, so you should use MP3 sounds only for background music and not play
several MP3 sounds at the same time. You can also use the new MP3 filter to play MP3 sounds in your
Windows applications, however this filter just calls the decoding API of Windows, so it depends on
codecs that are installed on the user's machine (Windows is usually provided with a MP3 codec though).
Note: if you redistribute an application that contains MP3 sounds you may need to get a MP3 license (at
the date this documentation was written, a license was not required for any entity with a MP3-related
gross revenue less than $100,000, but the terms of this license may change, check them from time to
time on mp3licensing.com).

Edit object

The iOS runtime supports the EDIT object, but you must be aware that only a few properties of the
object are supported under iOS :

z Multiple-lines
z Border only for single line objects
z Editable, only for single line objects
z Vertical scroll-bar only for multiple line objects
z Text and background color
z Object font

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Differences Page 2 of 2

The object also uses the standard iOS keyboards, and is automatically positioned in the center of the
screen above the keyboard when editing. If you want a finer control on the objects, just use the iOS
Single Line Edit object, or the iOS Multiple Lines Edit Object.

Runnning the application on various devices

Multimedia Fusion 2 does its best to allow your application to run on various screen sizes.

z The window size of the application is smaller than the device screen size
The application is zoomed and centered in the display. You do not need to worry about anything,
the process is completely transparent to you (screen and touch coordinates are zoomed etc). For
example, it's possible to run a 320x480 application on an iPad.
z The window size of the application is bigger than the device screen size
The application is reduced and centered on the device screen. Here too the process is completely
transparent to you. It is possible to run an iPad application (768x1024) on a 3rd generation iPhone
(320x480).
z The application is the same size than the device screen
The application is displayed without zoom.

The auto-zooming feature of Multimedia Fusion 2 allows you to create applications in the best possible
resolution without having to worry about which device it will run on. For an iPhone application, we
suggest that you choose a window size of 640x960 : it will be displayed in high resolution on a iPhone
4th Gen and over, and will work fine too on a 3rd and 2nd gen iPhone.

Fonts

PC fonts are replaced by their iOS equivalent when running on the device. Some things to know :

z Some of the fonts do not contain Italic or Bold, or both at the same time.
z The Helvetica font is mapped to the system font on iOS (which is a Helvetica font by the way). So
if you prefer to use the system font, choose Helvetica on the PC. The system font can be bold or
italic but not at the same time.
z If a font does not exist on iOS, the system font replaces it.

String objects

The fonts on iOS do not have exactly the same size as their PC equivalent. You might have to enlarge
the string objects so that the text is displayed properly.

Old device limitations with the HWA exporter

3G and 2G iPhone and iPod (3GS and up aren't affected) have some limitations when it comes to the
HWA blending modes.

z Blending coefficients are applied after the ink effect is applied. This means that using the 'invert'
ink effect does not give the same results.
z Drawing gradient or solid color quick backdrops does not draw if you give them a blending color
or transparency.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Things to know Page 1 of 3

Things to know when creating an iOS application


This section contains some important things to know when you create an application for the iPhone or
the iPad. Please read it carefully and keep it in mind when programming you application.

Building for various devices

Multimedia Fusion 2 allows you to build applications that can run on an iPhone, iPod Touch, or iPad. As
a default, the Targeted Device property of the application are set to iPhone / iPad, meaning that your
application will work on any of the available Apple devices at that date (March 2011). Modify this
property if you want to restrict your application to iPhone only or to iPad only.

Memory considerations

iOS devices are portable devices. As such, the amount of usable memory (RAM, not to be confused with
Flash memory where the files are stored) is limited. On a 2nd generation device, like the original iPhone
and the iPod 2nd Gen, the size of RAM is 128 Mbytes. On 3rd Gen devices and over, the amount of
RAM is 256 Mbytes.
This might seem a lot, but if you know that iOS 4 consumes at least 80 Mbytes to function, you quickly
realize that the amount of working memory on a 2nd Gen device can be evaluated to around 40 Mbytes.
The code of an iOS application must be copied into RAM before being launched by iOS : this takes 2
Mbytes out of your previous RAM.
The conclusion is that if you want your application to work on a 2nd Gen device, you have to be very
careful about the size of your graphics and sounds. The next section will give you tips to reduce the
memory imprint of your graphics.
If your game cannot run on such a device, you should prevent it from being distributed in the app store
for a 2nd Gen device. If you do so, save some memory by setting the build architecture of the
application in the iOS properties to Arm7 only, avoiding the duplication of the compiled code.

How to find out exactly how much memory your application takes?

The amount of memory used by an application is shown in the debugger window (top left of the screen)
when you launch your application in Multimedia Fusion 2. The memory displayed is evaluated for a PC
application and does not reflect the amount of RAM really taken by your application under iOS.
To find out exactly how much memory your application needs on the device, launch your application in
XCode by choosing the menu option "Run / Run with performance tools / Allocations".
XCode will automatically open a window that keeps track of all the memory allocations of your
application in real time. You will find the total amount of RAM used in the first line of the grid.
Be sure to check every frame of your application, as the amount of memory used depends on the amount
of graphics and sounds used in each frame.
Also check that the number of allocations (not the tempory allocations, which keep growing normally)
does not increase as your game runs (and might indicate undestroyed objects).

How to save memory for your graphics?

Alpha-channels
Alpha-channels look awesome and give a visually pleasing effect but they will slow down your game if
you overuse them, just as they do in the PC runtime (only more).
An image with an alpha-channel takes 33% more memory and space than an image without and it takes
more power and time to render them.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Things to know Page 2 of 3

Workaround:
Does your graphic really need the alpha-channel? Does the background underneath it ever change? If
not you could probably "bake" the alpha-channel effect into the image itself so that the shadow is just
part of the picture.

Huge pictures
Many are often tempted to import really large pictures into the game where it will only show very little
of that picture at one time. Some good advice is to break it up into smaller parts so that fewer of them
are shown at one time. Remember that any image you have in your game has to fit inside their texture.
In a sample game there was a 960x480 sized background image on a frame. This picture alone had to fit
into a 1024x512 texture taking up a huge amount of memory. What was even worse was that it had an
alpha-channel even though no pixel in it was transparent. Second, the same frame had two different huge
animations sized 957x158 (each of them contained 17 frames). This already takes up 2*17 * 1024*256 *
3 = 26738688 bytes = 25.5 MB of RAM which is way above what the iOS likes. That was even without
the rest of the graphics and the huge background image we talked about before.

Workaround:
Most graphics don't need 100% crispness and quality. It will only take 1/4th of the previous memory
usage if you cut your image size in half and then at runtime scale it to 2.0. It will also run much faster as
it utilizes the graphics card RAM cache much better.

Tip:
Crop your images, remove any useless empty space around them. Some developers tend to use a single
frame size for an entire animation with huge transparent parts in some images. It's probably better at
design time, but at runtime it results in a loss of time and space.

Tip:
Try to make your graphics of a size close a power-of-two. It will waste less precious memory.
A power-of-two size is one of the following: 8,16,32,64,128,256,512,1024 Images less than 8x8 pixels
will be stored in a 8x8 texture as they cannot be smaller than that.
You can easily use different sizes for your width and height, they don't have to be equal.

Tip:
Be sure to set the "Image compression" property to "Color reduction" either globally for all objects in
the App iOS properties or per object, as often as you can. In many cases, it will consume half the
memory it did before.
Take for example the big background image mentioned above. It wasted 2 MB of texture memory. With
color compression and no alpha channel it will only take 1 MB. If it was cropped to only fill out the
resolution of the iPhone device it would only take 30 KB. The animations mentioned before that took 25
MB of RAM can with color compression and half the resolution only take: 2*17 * 512*128 * 2 =
4456448 bytes = 4.25 MB! That is a huge difference.

Single color graphic


This is kinda an extension to the previous pitfall. We have often seen in the sample games we have
debugged some big actives (typical white) that are meant to cover the entire screen and fade to
transparent. People need to realize that even though they are pure white (or whatever color) they are still
stored in memory uncompressed at runtime and waste just as much memory as if it was a pretty picture.
If you need those fade-effects, you can scale a small active to fit the screen at runtime and gradually
alter it's semi-transparency.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
iOS Things to know Page 3 of 3

Transitions on big graphics


You should generally avoid using transitions on objects larger than the device screen resolution even
though it works well enough. Using a transition on such an object will consume a lot of extra memory
during the transition and can be slow. You have to try it at runtime to see if it gives you a noticeable
performance drop. Just remember that even though it doesn't hurt the FPS that much, it can still drain the
battery much more than you realize.

Speed considerations

Overuse of "text" counters/score and strings Although it may not be a big issue, it can hurt the
performance of your game if you use too many objects that draw text. If the text doesn't change, it
should not be a performance problem, but if you update your string/score/counters often you will get a
performance problem.

Workaround:
- Only use text whenever you know it will not change often (like every frame).
- Use bitmap counters/scores instead of text counters/scores. You can much better control the visual
style of your objects and there is nearly no performance penalty.

Too many transitions at one time


Each object that needs to have a transition effect will consume more memory than usual and will use
some special buffers on the device that aren't unlimited. Once you reach a certain limit you will begin
getting errors. Also, it will slow down performance if you have many transitions going on at one time.

Workaround:
- Instead of using transitions try using animations or other effects to give the same effect.
- Instead of using the "Fade" transition, manually setting the semi-transparency of your objects will be
much much faster and will not consume any more memory.

Unnecessary Ink-effects
We have seen other games almost ready for release where INK effects are unnecessarily used often.
Having a big background covering the screen and setting it to either transparent or ADD so that it will
be added to some gradient behind it, will only make your game slower and consume more power.
Instead, make your graphics as they should look at runtime and then use them like that. INK-effects are
only meant for places where you cannot modify the original image to look like it should at edit time. For
example, if you want a grayscale background from a picture, make it grayscale before you import it into
Multimedia Fusion 2. You simply don't put the monochrome INK-effect on it and forget about it

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\iOSA... 5/19/2013
XNA Applications Page 1 of 2

Multimedia Fusion 2 and XNA


The XNA exporter of Multimedia Fusion 2 allows you to build Xbox, Windows Phone or Windows
applications.

What do you need to create an XNA application ?

The XNA exporter of Multimedia Fusion 2 builds Microsoft Visual Studio projects that you have to
compile with Microsoft Visual Studio Express 2010 or Microsoft Visual Studio Express 2012.

z You are using Windows 7


You have to install the Windows Phone 7.1 SDK. The installer of Windows Phone 7.1 SDK
installs everything you need to build applications for Windows Phone 7, Xbox 360 and Windows.
Connect to http://dev.windowsphone.com/en-us/downloadsdk, download the installation package
and run it. It will install Microsoft Visual Studio Express 2010 (if Microsoft Visual Studio 2010 is
not already installed on your machine). Use Visual Studio 2010 to build and test your XNA
projects created with Multimedia Fusion 2.

Note: Windows 7 doesn't allow you to build Windows Phone 8 applications. If you want to create
Windows Phone 8 applications, you have to use Windows 8. See below.

z You are using Windows 8


If you want to develop Windows Phone 7, Xbox and Windows XNA applications, you have to
install the Windows Phone 7.1 SDK indicated above and use Visual Studio 2010 to build and test
the XNA projects saved by Multimedia Fusion 2.

If you want to develop Windows Phone 8 applications, please install the Windows Phone 8 SDK
available here: http://dev.windowsphone.com/en-us/downloadsdk. This SDK installs Visual
Studio Express 2012 (if Visual Studio 2012 is not already installed on your machine). You have to
use Visual Studio 2012 to build and test your Windows Phone 8 projects created with Multimedia
Fusion 2.

You will also need :

z If you plan to develop on Xbox, an Xbox, connected to your computer via a network (WIFI or
wire).
z If you plan to develop for Windows Phone 7.1, a Zune player, or a mobile phone running
Windows Phone 7 to test your applications on a real device (you can use the Windows Phone
emulator in Visual Studio, but it is rather slow).
z If you plan to develop for Windows Phone 8, a mobile device running Windows Phone 8 (you can
here too use the integrated emulator).
z You will also need to register as developer on Microsoft Registration Page.

Where to find documentation about XNA development ?

Although Multimedia Fusion 2 makes it simple to develop an Windows Phone or Xbox XNA
application, you will still need to read Microsoft's documentation. Documentation about XBox Live
Indie developpement can be found at http://xbox.create.msdn.com/en-us. Please read this documentation
to find out how to successfully connect your Xbox to Visual Studio and run your applications on the
Xbox from your PC.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Applications Page 2 of 2

Documentation about Windows Phone developpement can be found at :


https://dev.windowsphone.com/en-us.
Interesting documentation about XNA Game Studio 4.0 Refresh (installed by the Windows Phone 7.1
SDK) can be found here...

Thank you!

We would like to thank the following persons for their help in the finalisation of this product. Thank you
for your help and suggestions !

z Federico Aliprandi
z William Bourdon
z Chris Street
z Dave Vout
z Thomas "Reggie" Schreiber
z Cole Jefferies
z Hiroshi Ashida
z Wilhem Clemm
z Sean Yearwood
z Alex Ramsey
z Ahsley Bates
z Roger Mestner
z Chris Tumbour
z Jens von Dijt
z Gerald Little
z Takkazary Hashimoto
z Marcus Pasell
z Tomasz "Fanotherpg" Kaczmarek
z C. Fuller
z José Raphael Marcano
z Tom Shreiber
z Rami Bahgat
z Andy Hewitt
z Pedro Güida
z Daniel Logan
z Jonathan Gooler
z Thorsten Gunia
z Evan Numbers
z GameDreamsX
z Nicolas Morin

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
Building XNA Applications Page 1 of 2

Building your XNA Application


What to do the first time you build your application?

z Select one of the XNA Project build types : "XNA Windows project", "XNA Xbox Project" or
"XNA Phone Project".
z Choose "File / Build / Application", and enter the name of your project (which will be the name of
your application), and the path where to create the project folder. Multimedia Fusion 2 creates a
new folder containing a complete Visual Studio XNA project.
z Launch Visual Studio 2010 or Visual Studio 2012 (depending on your version of Windows and
the target project you want to build, as explained before).
z Select Open project, and choose the sln file at the root of your project folder.
{ Windows XNA application
Once your project is loaded in Visual Studio, press F5 to run the application.
{ Xbox XNA application
To enable debugging on the Xbox, the first thing to do is to add your Xbox to the list of
recognized devices in "XNA Game Studio Device Center". This application can be found in
the "Microsoft XNA Game Studio" submenu of your start menu.
Once your Xbox is added to the list of devices, you must switch it on, and start the "XNA
Game Studio Connect" application on it.
Under Visual Studio Express, select the name of your Xbox in the "XNA Game Studio
Device Management" toolbar and press F5. Your game data (images, sounds and fonts) will
be uploaded to the Xbox using the WIFI network, and your application will start. Uploading
the data can take a significant amount of time if your game contains a lot of images.
More info on MSDN
{ Windows Phone development : registering your phone
Although Visual Studio 2010 or 2012 contain a Windows Phone emulator, nothing can
replace a test on an actual device. Simply connecting your phone to your PC with an USB
cable is not enough : you have to register your phone with Microsoft. The procedure is
explained in this page : How to register your phone for development. Once your phone is
registered, simply select it in the Visual Studio toolbar and press F5 to start the application
on the device.

What to do during development :

Now that you have a working project on your PC, there is no need to rebuild the entiere project each
time you want to test your application. A much simpler method is provided by Multimedia Fusion 2.

z Go in the Application properties, "Build type", and select one of the following build types
(depending on the type of your application) "XNA Windows Application", "XNA Xbox
Application" or "XNA Phone Application"
z Build your application as usually, but as a file name, choose the sln file at the root of your XNA
project. This will save the content of your application in the project folder.
z Go back to Visual Studio and rebuild your application. Note that if Visual Studio is opened when
you save your application, it will ask to reload the project and the content. You should accept
these actions.

Basic and Expert settings in Visual Studio


Visual Studio Express offers two main settings : the basic settings and the expert settings. To switch
from one setting to another, select the option in the "Tools / Settings" menu. The expert setting offers an

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
Building XNA Applications Page 2 of 2

important option : the choice between Debug and Release mode.


When you load a newly created project in Visual Studio, the default compilation mode is set to Debug.
The code produced in debug mode is slower, as it is not optimised for speed. It is though easier to debug
and step through the code should you be interested in discovering how the XNA runtime works.
To test and publish your application, we suggest that you switch to Release mode. Choose "Release" in
the Combo box available in the "Build configurations" toolbar. The main feature of the release mode is
the optimisation of the code, making the application run faster. When you package your application for
distribution, you must compile in release mode.
If you ever encounter a problem with the XNA Runtime (a crash or an error), we suggest to switch to
Debug mode, and carefully write down the line where the error occured and the error message : this
information can help us find the source of the problem.

Packaging your application for distribution


To distribute your application, you must first compile it in Release mode. And then:

z Windows XNA Application


Right click on the name of the project in Visual Studio's project window, and choose the "Publish"
option. Visual Studio will create a complete installer for your application, ready to be distributed.
z Xbox Application
Right click on the name of your application in Visual Studio's project window. Choose the
"Package as XNA Creators Club Game" option. Open the folder containing your project, and go in
the following subfolder : ApplicationName\ApplicationName\bin\Xbox 360\Release. The file
"ApplicationName.ccgame" contains your game ready for distribution.
z Windows Phone Application
Once your application is compiled in Release mode, open the project folder of your application.
Open the following sub-folders : ApplicationName\ApplicationName\bin\Windows
Phone\Release. You will find your compiled application in the release folder under the name
"ApplicationName.xap". This is the file you will distribute.

Game certification

z Windows Phone
Before being distributed, your application must be certified by Microsoft. Microsoft tests your
game and ensures that it follows a set of rules to ensure both the quality of the game, and a good
user experience. Prior to submitting your project, you should review the Application Certification
Guidelines to ensure that your app or game is ready.
z Xbox
The certification process is not the same, your application will be reviewed and validated by the
Xbox LIVE community. More info here : Xbox Peer Review FAQ

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Properties Page 1 of 2

XNA specific properties


When you choose one of the XNA build types in the properties of the application, new properties
appear.

Application properties

These properties are located in an XNA folder on the right of the property explorer.

z Font mapping
These properties allow you to indicate what characters will be mapped to the graphic fonts used in
your application. Note that an error will occur if you try to display a character that is not mapped.
First character is the Unicode code of the first character to map, Last character is the Unicode
code of the last character to map. The default setting include the entiere ASCII character set. You
should increase the "Last character" value for Unicode applications.
z Display status line
This property is only available for Windows Phone build.
Uncheck this property to hide the phone status line. Note that keeping the status line will hide a
portion of your application.
z Screen orientation
This property is only available for Windows Phone build.
It allows you to fix the orientation of the screen when your application runs. "Automatic" lets the
device set the orientation depending on the dimensions of the application : if the width is smaller
than the height, then a portrait orientation will be used, if it is larger than the height, then one of
the two landscape orientations will be used, depending on the device position. Note that in
automatic landscape mode, the screen will flip if you incline the device in the other direction (to
prevent that, do not use the automatic mode).
z Joystick images
This property is only available for Windows Phone build.
It contains the images of the touch joystick. Refer to the Joystick property below for more
information.
z Assembly information properties
The assembly information contain important data that are used when you publish your application.
You should at least define the title and assembly version, if you do not, your application will be
rejected.
{ Title
This property contains the title of your application.
{ Description
You should enter a brief description of your application in this property.
{ Company
Enter the name of your company, or your own name in this property.
{ Product
Enter the full name of your application in this property.
{ Copyright
This property should contain the copyright message protecting your application.
{ Trademark
Enter the trademark of your application, if applicable.
{ Assembly version
This property contains the version number of your application, in the form 1.2.3.4 . This
version number is very important if you plan to publish you application.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Properties Page 2 of 2

{ File version
This property is only available for Windows applications. It should contain the version
number of the executable file. This number can be the same as the Assembly version.
{ Language
This property contains the language of your application.
z Background
This property is only available for Windows Phone.
This 173x173 image is used as background to display an enlarged representation of your
application on the phone.
z Game Thumbnail
This property is only available for Windows Phone and Xbox.
This 64x64 image is used to display the icon of your application in the phone's menus or in the
Xbox menus.

Frame properties

These properties are located in an XNA folder on the right of the property explorer, and are available in
Windows Phone mode only.

z Disable idle timer


If your game does not not induce the user to touch the screen (use of accelerometers, or static
frames), the device might automatically go into energy saving mode after a period of time by
reducing the lighting of the screen and then shutting off.
By checking this property, you will prevent the phone from going to idle mode. The phone will
remain activated for the duration of the frame. If in the next frame this property is not checked,
then the idle timer detection will resume.
Use this property with caution as it might drain the user's battery!
z XNA Joystick / Device
Multimedia Fusion 2 allows you to emulate a joystick in the XNA application. With this, you can
use Multimedia Fusion 2 default movements, controlled by a joystick on the device. This combo
box offers you the choice of joysticks :
{ None
No joystick is displayed. Only use this property when your frame does not contain any
joystick-controlled movement
{ Touch joystick
The joystick is emulated on the bottom of the screen of the device. Using your fingers, you
can control the movements. The joystick consists of a paddle button and two fire buttons.
{ Accelerometers
The movements are controlled by the position of the device. Two fire buttons are available
on the screen.
{ Controlled by an extension
Choose this property to manually start or stop the joystick using the Joystick Control object.
Please note that this object will not work if this property is not set to this value.
z Fire 1 button
Check this box if you want the Fire 1 button to be displayed
z Fire 2 button
Check this box if you want the Fire 2 button to be displayed.
z Left handed
Check this box to have the paddle on the right and the fire buttons on the left of the screen.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Differences Page 1 of 2

Differences between XNA and PC applications


The XNA file exporter tries to make your XNA applications work as closely as possible as your
Windows (stand-alone) applications that you can see in action when you execute the "Run Application"
or "Run Frame" commands, but there are some differences between XNA and EXE applications. These
differences are usually minor, but they can affect the way your program works. Here is the list of the
main differences.

z String object, text height calculation


There might be some differences in the calculation of a string height, resulting in a sligthly
different vertical centering of the string objects.
z Fonts
XNA fonts are embedded in the application when you build the project under Visual Studio. The
fonts must a) be present on the machine, b) convertible to a graphic font. Not all the fonts can be
converted to graphics, so you might get build errors when compiling the application with certain
fonts.
Multimedia Fusion 2 automatically embeds the fonts used in the string and hiscore objects.
To reduce the size of the graphic font, reduce the number of characters mapped in the XNA
property page. The default settings include all ASCII characters. For Unicode character sets,
increase the "Last character" value.
z Date & Time object font
Some Date & Time objects may have a default font set to "SYSTEM" in their properties. This font
does not exist in XNA : if you try to build and compile the XNA application, you will get a
compiler error. You have to replace the font by an existing font to compile the project.
z Sounds
You cannot play external sample files (only internal samples).
z MIDI music
MIDI music is not supported in XNA.
z Many properties of the application and the frame available in Windows are not applicable to
XNA applications. These properties will be grayed out when you turn your Windows application
into a XNA project (by changing the Build type in the application's properties). After being grayed
out, even if they are checked, they will have no effect. Example of properties without effect :
{ "Keep display from previous frame".
{ "Window style properties".
{ "Window menu".
{ "Change resolution mode".
{ "Resize display to fill window size".
{ "Machine Independent Speed".
{ "etc.".
z Mouse-driven movement
The mouse movement in XNA is different from the normal mouse movement. The object is
positionned just under the mouse hidden pointer. This implies that the mouse pointer must be
above the play area for the object to move.
z Effects
Effects are supported as well as the HWA alpha-blending and RGB coefficients. Shaders are not
supported. Frame and layer effects are not supported.
z Transitions
Transitions are not supported under XNA.
z Keyboard and mouse events
... They do not occur at exactly the same time in the game loop. This might cause some problems

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Differences Page 2 of 2

in your application (like objects flashing when you set their position responding to a mouse click).
z Frame rate
The frame rate is limited to 30 fps on the majority of Windows phones.
z Speed of application
In a XNA application, displaying the frame and handling it are separated. XNA tries to maintain
the rate at which the frame handling routines are called, and calls the display routine if there is
enough time. This has a main disadvantage : if the frame handling routine takes longer to execute
than the actual frame rate, the display routines are called every one second or so. Only a small
overhead of time in the handling routine can provoque a catastrophic display rate.
If this happens to you, you will have to reduce the frame rate of your application (in the
application properties), until the handling routine execution time falls under the threeshold. You
can also choose to simplify the events of your frames.
z Loading files in Ini, List, Combo box and Array object
The save and load actions of these objects are enabled in XNA.
You can include the file to load in the binary files of your application, or in the resource project
directly under Visual Studio. The objects will first try to load a file previously saved by the
application in application bundle (Windows Phone) or in the current device (Windows and Xbox).
If not found, they will look for the file in the binary files of the application. If not found again, the
will look for the file in the resources of the XNA project.
If you want to publish a default file for these objects along with your application, we suggest to
put it in the binary files : if you put it in the resources of the Visual Studio project, you will have
to re-enter it after each build.
On Xbox, a storage device selector dialog can appear just before the file is saved or loaded. To
avoid the appearance of the dialog at undesired moments in your application, you should use the
"Open storage device selector" action of the XNA object during the initial menu pages of your
game.
The objects only take into account the name and extension of the file, not the path : you can use a
complex pathname in the PC emulation (for example pointing to the directory where your
application resides), this will not affect the XNA version.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Things to know Page 1 of 2

Things to know when creating XNA applications


This section contains some important things to know when you create an application for Xbox or
Windows Phone. Please read it carefully and keep it in mind when programming your application.

z Tab key
On Xbox, selecting buttons, list and combo object is done via the UP and DOWN keys of the
gamepad. On Windows Phone, you have to touch the control to activate it.
z How to keep you application small.
Keep the size of your application to a minimum. Here are a few hints to keep the size down:
{ Do not use large backdrop images, but repeat smaller backdrop objects. A large image can
be quite big, specially if it is complex. Even if the images are highly compressed, a big
image will increase the size of the XNA file. Most of the time, the background of a game
can be created by repeating smaller elements at different locations. Also do not forget the
Mosaic option in the Quick backdrop object.
{ Use scaling and rotation. Active objects can be rotated and scaled. You should use this
feature for as many objects as possible, thus reducing the amount of graphics in your file.
Sometimes you can just create the animations of your object in the "right" direction, and
then check the "Automatic rotations" property in the object's runtime properties. Your
object will be automatically rotated depending on the direction of the movement. A
drawback of the rotation and scaling can be speed if your object is involved in collisions
though. Only experimentation will tell you what is better.
{ Use sounds carefully. Sounds take a lot of space. Use too many sounds and your
application size will grow rapidely.
z Opening web pages
You can use the XNA object to open web pages from your application, on Windows Phone only,
and therefore create reactive areas to allow the user to connect to your website.
z Sounds
XNA applications can play two kinds of sounds : MP3 sounds, called "Songs", or WAV, called
"SoundEffects". Multimedia Fusion 2 automatically chooses the correct type of sounds depending
on the type of the sound file you use in your play sample action. MP3 sounds will be played as
such, using the hardware decoder when it is available on a Windows Phone. Any other kinds of
sounds (OGG, WAV) will be converted into WAV files when building the application, and played
as SoundEffects on the device. This has an important consequence : OGG sounds are not built as
such, but as WAV files, and therefore are much larger files. You should avoid playing OGG
sounds except for small sound effects.
z Sounds and Windows Phone
To obtain the certification of your application by Microsoft on Windows Phone, if your game
contains a background music, you must play this music as a "Song", (as a MP3 file). Microsoft
will refuse applications with background music that are not played as Songs. If a music is playing
on the device at the moment when the application is launched (from Zune), Multimedia Fusion 2
will not play the application's background music, to respect Microsoft Certifications. Normal
sound effects (WAV files) will play normally though.
As of February 3rd, 2012, on Windows Phone, if you attempt to play a song file while the device
is connected to the PC via Zune it will throw an exception (DRM). You can either test the game
after disconnecting the device or instead of using Zune use the WPconnect tool. This problem will
be corrected by Microsoft in a next update.
z Xbox storage device selector
When several mass storage devices are connected to an Xbox, a storage device selector screen
appears prior to saving data, allowing the user to choose on which device the data is to be saved.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013
XNA Things to know Page 2 of 2

For example, if you use the INI object, the selector will appear when you change the content of
the INI file. The device selector is only shown once in the game's lifetime.
The device selector pauses the game, and resumes it when the device has been chosen.
The interface of the device selector is controlled by the system player (see later)
We strongly recommend that you use the "Open storage device selector" action of the XNA
Object in the initial screens of your application, at a chosen, non intrusive time, ensuring a non-
interrupted gaming experience with your game. Furthermore, if you do not open it manually, the
device selector might appear just before a frame change in your game, causing unexpected results.
z System player
On Xbox, the device selector or the virtual keyboard (that appears when you use an edit object) is
controlled by player 1 by default. To pass the certification process for distribution, you have to
make sure that the player who controls the interface is the player actually playing the game. You
should use the "Set system player" action of the XNA object at the beginning of your game, as
soon have you know which player is playing.

mk:@MSITStore:C:\Program%20Files%20(x86)\Multimedia%20Fusion%202\Help\XNA... 5/19/2013

You might also like