In a previous post of mine, I sung the praises of using straight Flash as a UI system. In theory and practice, it works in the form of Scaleform. Flash offers many nice graphical features that would be difficult to rendering normally. The implementation I used basically wrapped the Shockwave COM object and exposed many of it’s methods in an easy way. Rendering was more complex as I had to get access to a DirectX 11 Texture’s GDI context in order to render to it. This process worked, but not really.
The interface exposed ways of calling back and forth between Flash and the application, but it used the old, deprecated method of
fcommand(). Setting variables from the application into Flash also required that the variables be set in global scope to be filled in by the application later. Debugging this was a nightmare as there was no way to use the built in Flash debugger as the application was not setting these variables to begin with. This method of variable setting and calling
fcommand() are deprecated in ActionScript 3 and don’t even run properly.
If that wasn’t bad enough, when we were about to demo the game, I noticed that the Flash wrapper had major issues with the mouse. Moving the mouse with the cursor on the screen would severely degrade the Flash playback speed. It was so bad that in some cases Flash would stop rendering entirely. This was a huge issue that we couldn’t solve in the time remaining and just had to deal with for the demo by moving the mouse off the screen before anything started running and not moving the mouse at all.
Another great thing is that all development and debugging can be done in a web browser, completely separate from the actual game. Here is what I have so far. Nothing is hooked up yet, but it shows the possibilities and power of this simple, elegant solution: