Is it possible to create a user interface using sub-apps?
I tried place the level as a sub-app and putting a UI over it but the UI disappears because the sub-app stays in front of it even if i code it not to
I don't want it to scroll with the character in the level either.
Any ideas?
Would the viewport object help? If so, how do I use it?
Depends what kind of user interface you're using. If you wanted to use subapps, you'd have to put the INTERFACE in the subapp, and place that over the level. At the moment, sounds like you're trying to do it the other way around.
The problem with this though, is that it's very hard and very slow trying to get any kind of semitransparency for a subapp. So you'd need to just use basic boxes, which is a bit lame.
Your best bet is to code things like the heads up display (lives, health, coins collected or whatever) on a separate layer in the level.
As for pause menus, you can handle these using subapps, because the subapp (with 'MODAL' setting ticked) will automatically pause the game underneath it. You can use screen capture to load a copy of the game's current display as the background for the subapp, thereby creating a menu that LOOKS like it has semitransparency and alpha effects in it.
In TGF, I just pause the game by putting every single event in a control group, deactivating all groups, stopping all animations and movements (I don't think I've used any movements...), and restarting them all when unpaused.
Frankly making your HUD inside of the level, rather then with subapps, is generally the best choice. If you really insist, your best bet imo would actually be to resize the window of the gameplay; cut it vertically by XX amount, then add an XX subapp window below it, stuck in place. Or just do the screen capture like deadman says
This is a task that can be accomplished very easily by simply using MMF2's layers, because you can set the co-efficient of the entire layer to 0.0 making it so that anything on that frame will automatically stay on the screen. Layers are useful for more things then just scrolling.