Currently, I am in the middle of writing my third book with Packt Publishing, this book on creating a single project over a longer period of time and while we do have 120 pages for the book, there was so much more that I wanted to put in, such as UnrealScript. So here is the first in a series of things that didn’t make the cut, but I feel would be useful for others to look at. This section of the book comes in Chapter 4, where I go into detail on how to build a custom HUD as well as main menu to finish up our game. But, in order to do that you need to set up Flash for use with Scaleform. This goes over how to actually get it set up with minimal hassle:
Setting up Flash
Our first step will be setting up Flash in order for us to create our HUD. In order to do this we must first install the Scaleform Launcher which is what we’ll be doing first.
At this point I will assume that you have already run Adobe Flash CS6 at least once beforehand. If not, you can skip this section to where we actually import the .swf file into UDK. Alternatively you can try to use some other way to create a Flash animation, such as FlashDevelop, Flash Builder, or SlickEdit but that will have to be on your own.
The first step will be to install the Scaleform Launcher. The launcher will make it very easy for us to test our Flash content using the GFX hardware accelerated Flash Player which is what UDK will use to play it.
1. Open up Adobe Flash CS6 Professional. Once the program starts up open up the Adobe Extension Manager by selecting Help | Manage Extensions….
You may see the menu say Performing configuration tasks, please wait… this is normal, just wait for it to bring up the menu below:
2. Click on the Install option from the top menu on the right side. In the file browser, locate the path of your UDK install then go into the Binaries
\GFx \CLICK Tools \ folder and once there select the ScaleformExtensions.mxp file and then select OK.
3. When the agreement comes up, press the Accept button then select if you want the program to be installed for just you or everyone on your computer.
4. If Flash is currently running you should have a window popping up telling you that the program will not be ready until you restart the program. Do that and close the manager.
5. With your reopened version of Flash start up the Scaleform Launcher by left clicking on Window | Other Panels | Scaleform Launcher.
- At this point you should see the Scaleform Launcher panel come up.
At this point all of the options are greyed out as it doesn’t know how to access the GFx player, so let’s set that up now.
· Click on the + button to add a new Profile. In the profile name section type in FXMediaPlayer. Next we need to reference the GFX player. Click on the + button in the player EXE: selection. go to your UDK directory then Binaries\GFx\ and then select GFxMediaPlayerD3d9.exe. It will then ask you to give aPlayer Name: with the value already filled in, just hit the OK button.
UDK by default uses DirectX 9 for rendering. However, since GDC 2011 it has been possible for users to use DirectX 11. Should your project be using 11, feel free to check out http://udn.epicgames.com/Three/DirectX11Rendering.html and use d11, should you be so inclined.
6. In order to test our game we will need to hit the button that says Test with: GFxMediaPlayerD3d9 in the middle.
If you know the resolution in which you want your final game to be, you can set up multiple profiles to preview how your UI will look at a specific resolution. For example if you’d like to see what something at the resolution 960×720, you can do so by altering the command params field after %SWF PATH% to include the text -res 960:720.
7. Now that we have the player loaded, we need to install the CLIK library for our usage. Go to the preferences menu by selecting Edit | Preferences. Click on the Actionscript tab and then click on the ActionScript 3.0 Settings… button.
8. From there add a new entry to our Source path by clicking on the + button. After that click on the folder icon to brows to the folder we want. Add an additional path to our CLIK directory in the file explorer by first going to your UDK install directory then going to Development\Flash\AS3\CLIK.
9. Click on the OK button and drag and drop the newly created Scaleform Launcher at the bottom right of the interface.
Alright, Flash is now set up for us to work with Scaleform within it and for all intents and purposes probably the hardest part about working with Scaleform. Now that we have that taken care of, let’s get started on the HUD!
As long as you have admin access to your computer, these settings should be set for whenever you are working in Flash. However, if not you will have to run through all of these settings every time you want to work on Scaleform projects.