Official continuation of Destination Sol, the great fun little arcade space shooter from http://sourceforge.net/projects/destinationsol/ Modules live at https://github.com/DestinationSol/
This pull request replaces the pre-existing menu screens with NUI equivalents. All of the screens comprising the main menu, except for InputMapScreen have been ported. Whilst doing this, I found that some changes to NUIManager were needed to correctly maintain screen state. I also took the opportunity to improve UI asset loading slightly, as I found that it was duplicating quite a bit of that code previously. The UIFont class has been removed, which is a good thing since it was only ever intended to be a temporary fix for font scaling. Font scaling was implemented in a better way with the NUI Main Game Screen changes, so I have moved the rest of the code to use the scaled font producer instead.
I have not managed to replace InputMapScreen yet, as it is a more complex layout and my grasp of NUI UI layouts is still fairly immature. I am working on it though.InputMapScreen has now been implemented.
API Changes
NUIScreenLayer#initialise is now only called once when the UI asset is loaded by NUIManager#createScreen.
Added NUIScreenLayer#onAdd, which is called whenever the screen is added to the UI stack.
Added Assets#getUIElement to obtain a UIElement asset more easily.
Added NUIManager#setScreen for replacing the entire UI stack with a single screen.
InputManager#setScreen now accepts a null screen argument to clear all screens. This becomes more needed as we reach the point where only NUI screens are shown at one time.
Testing
Use a build of Destination Sol without these changes and start going through all the menu screens. Observe how they behave and appear.
Then test against a build with these changes. The UI screens may look different but they should be similar and functionally identical.
Some things to double-check
Do all the key bindings work the same as before?
Can you change the screen resolution successfully?
Do the layouts appear consistent?
Is there any text going off-screen? (note: the credits text is known to go off-screen with these changes due to its very large height)
Description
This pull request replaces the pre-existing menu screens with NUI equivalents. All of the screens comprising the main menu, except for
InputMapScreen
have been ported. Whilst doing this, I found that some changes to NUIManager were needed to correctly maintain screen state. I also took the opportunity to improve UI asset loading slightly, as I found that it was duplicating quite a bit of that code previously. TheUIFont
class has been removed, which is a good thing since it was only ever intended to be a temporary fix for font scaling. Font scaling was implemented in a better way with the NUI Main Game Screen changes, so I have moved the rest of the code to use the scaled font producer instead.I have not managed to replaceInputMapScreen
yet, as it is a more complex layout and my grasp of NUI UI layouts is still fairly immature. I am working on it though.InputMapScreen
has now been implemented.API Changes
NUIScreenLayer#initialise
is now only called once when the UI asset is loaded byNUIManager#createScreen
.NUIScreenLayer#onAdd
, which is called whenever the screen is added to the UI stack.Assets#getUIElement
to obtain aUIElement
asset more easily.NUIManager#setScreen
for replacing the entire UI stack with a single screen.InputManager#setScreen
now accepts a null screen argument to clear all screens. This becomes more needed as we reach the point where only NUI screens are shown at one time.Testing
Some things to double-check
Notes