If you want to contribute to the forum discussions, please
I have a question about usage of the UIScreen class. I have several menu states, and I transition between them when the user clicks on a button or presses a key (e.g. from MainMenu to OptionsMenu). I have some animation that fades the old menu out and the new one in for a transition period. Each menu state has a UIScreen instance, and each UIScreen contains a Window, which contains the menu title, buttons etc. I'm just wondering if there's much difference in efficiency terms in using a UIScreen for each menu state as opposed to using a single UIScreen that contains all of the Windows and just enables and makes visible the ones that are active at the time. In my code, I only load each UIScreen and containing Window once (on the first time the menu state is entered), and keep them around in memory after that. If a screen isn't active, I just set IsEnabled and IsVisible to false.
Does this seem like a reasonable way to go about things, or is there a more efficient way? (e.g. using a single UIScreen)
Thanks for your help. The support at DigitalRune is fantastic by the way compared to most other software companies.
Both (using multiple UIScreens or a single, shared UIScreen) are viable approaches. Performance-wise there should not be much of a difference and I actually don't know which is faster. I would have to test and analyse both approaches in a real-world sample.
I recommend that you use the approach that makes the code most readable.