2.4 Mobile platforms

Hollywood is also available as a player-only version for Android and iOS which allows you to run your Hollywood applets on smartphones and tablets. The Hollywood Player for Android requires at least Android 4.0 and is freely available on Google Play at this URL: http://play.google.com/store/apps/details?id=com.airsoftsoftwair.hollywood. Unfortunately, the Hollywood Player for iOS is currently not available on the App Store because its capabilities seem to conflict with Apple's App Store rules.

Here are screenshots of the Hollywood Player for Android (left) and iOS (right):

If you want to run your Hollywood projects on your mobile device, you first need to compile them as Hollywood applets, copy them to your device and then run them using the Hollywood Player for your mobile platform.

Alternatively, there is also an add-on named Hollywood APK Compiler which can be used to compile your Hollywood projects into stand-alone APK files for Android. Please visit the Hollywood portal for more information on the Hollywood APK Compiler: http://www.hollywood-mal.com

If you want to use the freely available Hollywood Player, read through this step-by-step guide to get your Hollywood projects onto your mobile device:

  1. Compile your Hollywood project as a Hollywood applet (*.hwa) in the Hollywood GUI or in Designer or from the command line.
  2. On Android systems: Copy the *.hwa file to the directory Hollywood on your Android's device SD card. The directory Hollywood is automatically created when you first launch Hollywood on your Android device. If it is not there, create it on your own. It has to be in the root directory of your SD card.
  3. On iOS systems: Use iTunes to copy the *.hwa file to the documents directory of the Hollywood Player app.
  4. If your applet does not load any external files and has all files linked in, skip to item 7.
  5. If your applet loads external files, create a directory for your applet inside the Hollywood directory (on Android) or inside the Hollywood Player app's documents directory (on iOS). The directory name must be identical to the name of your applet minus the file extension (*.hwa). For example: If your applet is called My cool game.hwa, you have to create the directory My cool game for it inside the Hollywood or documents directory.
  6. Copy all data files required by your applet into the newly created directory.
  7. Run the Hollywood Player on your device. A list of all applets that could be found will be shown. Select your applet and then touch the play button in the control bar at the bottom of the screen.
  8. Now your applet should start!

On Android you can alternatively also copy the Hollywood applet to an arbitrary location on your SD card and start it by simply running the *.hwa file directly from your favourite file manager. In that case all external files referenced by the applet will be loaded from the location relative to the folder where the *.hwa file is located. Hollywood will not change the directory to a subdirectory named after the applet in the case that the applet has been placed outside of the /sdcard/Hollywood folder.

You can configure some options by touching the "Options" button. The options screen looks like this on Android (left) and iOS (right):

The following options are currently available:

Full screen (auto scale):
Runs the script in full screen mode using the auto scaling engine. This is the recommended way to make sure that scripts designed for a different resolution cover the whole screen of your mobile device. If your script uses layers and vector graphics, however, you should use the layer scaling engine instead to get perfectly crisp graphics in any resolution (see below).

Full screen (layer scale):
Runs the script in full screen mode using the layer scaling engine. This is only supported for scripts which use layers. It is slower than the auto scaling engine but can lead to perfectly crisp graphics in any resolution if your script only uses vector graphics. For scripts that don't use layers, you should use the auto scaling engine (see above). Note that you can also use the auto scaling engine for scripts which use layers but then the quality won't be as good as with the layer scaling engine if your script uses vector graphics. That's why it is recommended to use the layer scaling engine only for scripts which use layers and vector graphics. For scripts which use layers and pixel graphics, you should use the auto scaling engine because it is faster.

Interpolate:
Use anti-aliased interpolation when scaling. This is recommended to get smoother graphics with less scaling artifacts.

Hide action bar
Hide the action bar on Android. This is recommended for scripts that don't need any user interaction through options in the Android action bar.

Hide status bar:
Hide the status bar on iOS if there is one. Enabling this option will result in a full screen display.

Hide options menu:
Do not allow changes to the display configuration through the options menu in the action bar. If you activate this, no options menu will be visible in the action bar. This is only supported on Android. On iOS, Hollywood doesn't have support for changing options while it is running a script.

Keep screen on:
Force the mobile device to keep its screen on even if there is no user activity. Normally, mobile devices will automatically switch into battery saver mode after a certain amount of user inactivity time. Ticking this option will disable this behaviour.

No sound:
Activates this option to start Hollywood in mute mode.

See console arguments for more detailed information on the options listed above.

The mobile versions of Hollywood have some special features in comparison to the desktop versions. Here is a list of special features in Hollywood for Android and iOS:

  1. On Android and iOS Hollywood comes with native support for Ogg Vorbis and Ogg Theora. You do not need any plugins to open these file formats. They will run out of the box on Android and iOS.

  2. You can show a virtual keyboard by using the ShowKeyboard() and HideKeyboard() functions. You can also listen to the HideKeyboard event handler to find out when the user closes the virtual keyboard. See InstallEventHandler for details.

  3. You can listen to the OrientationChange event handler to find out when the user rotates the device. See InstallEventHandler for details.

  4. You can also hard-code an orientation that your script shall use by specifying the "Orientation" tag that is supported by the @DISPLAY preprocessor command. In that case, Hollywood will not react to orientation changes when the user rotates the device. Instead, it will keep the orientation mode that you specified in the "Orientation" tag. See DISPLAY for details.

  5. On Android, you can also toggle between fullscreen and non-fullscreen mode by using the options menu in the action bar.

Naturally, there are some limitations in the mobile versions of Hollywood. Most prominently, in contrast to the desktop versions of Hollywood, the iOS version of Hollywood does not support multiple displays but only a single one. Also on iOS, displays cannot use menus. Furthermore, it is not possible to change the mouse pointer because there is typically none on Android and iOS. It is also not possible to use transparent BGPics and the Desktop tag in @DISPLAY is also unsupported.

Here is a list of commands which are currently not supported by the mobile version of Hollywood:

 
- ActivateDisplay() (only unsupported on iOS)
- ChangeDisplayMode() (only unsupported on iOS)
- CloseDisplay() (only unsupported on iOS)
- CreatePointer()
- CreatePort()
- DebugPrompt()
- FontRequest()
- FreePointer()
- GetEnv()
- GetFileArgument()
- HideDisplay() (only unsupported on iOS)
- HidePointer()
- MovePointer()
- OpenDisplay() (only unsupported on iOS)
- SelectDisplay() (only unsupported on iOS)
- SendMessage()
- SetPointer()
- SetEnv()
- ShowDisplay() (only unsupported on iOS)
- ShowPointer()
- UnsetEnv()

There are also some functions that are exclusive to the mobile versions of Hollywood. Here is a list of functions which are only available in the mobile versions of Hollywood:

 
- CallJavaMethod() (Android only)
- GetAsset() (Android only)
- HideKeyboard()
- ImageRequest() (Android only)
- PerformSelector() (iOS only)
- PermissionRequest() (Android only)
- ShowKeyboard()
- ShowToast()
- Vibrate() (Android only)

The Android version of Hollywood also supports Hollywood plugins. You have to copy them to the directory Hollywood/Plugins on your SD card. Hollywood will scan this location on every startup and load all plugins from there. The iOS version of Hollywood currently doesn't support plugins.

If your script runs extremely slow on a mobile platform, then you need to change your drawing technique. Refreshing the screen can be quite expensive on a mobile device which is why you should try to minimize the frequency of screen refreshes. The best way to do this is to use double buffered drawing using BeginDoubleBuffer() and Flip(). Things that will slow down the graphics engine on mobile devices are many drawing operations that affect only small areas. Thus you should try to combine as many drawing operations in just a single call. A double buffer is the best solution for this problem. If you cannot use a double buffer for some reason (for example, because you are using sprites or layers), encapsulate all drawing commands needed for drawing a frame within a BeginRefresh() and EndRefresh() section. Then the performance should be much better on mobile devices. See BeginRefresh for details.


Show TOC