09-07-2010 01:42 PM - edited 09-07-2010 02:00 PM
got a quick one for all the smart ones out there.
I am developing an app with a toolbar at the bottom. I would like to keep this toolbar visible on all the screens in my app.
I have extended the Screen class to add functionality like a screens parent screen and navigating b/w the two using the back button.
Now my question is:
Instead of redrawing/adding the toolbar component on every screen can I somehow modify my extended Screen class to only draw in a certain portion of the screen (so that the toolbar always remains visible) ? kind of like reducing the screen area just for this purpose ?
09-07-2010 02:34 PM
Welcome to the forums!
Since only the topmost (active) screen receives keyboard and navigation events, your toolbar has to be on it, not on some screen below that.
However, you may use a different approach: have only one screen and replace "content" managers as necessary. It will mean a little more work for you keeping track of your "screens" (actually, managers) stack, but your toolbar will stay the same.
You may draw some useful ideas from the following knowledge base entry:
09-07-2010 05:33 PM
I agree with the previous poster.
Just one point, in my experience, repainting part or repainting all of the screen has very little impact on perceived performance if you only do it once in a white, like when you swap from one screen to another.
Repainting the entire screen to move a sprite around is not such a good idea. In my experience minimizing the area you invalidate when doing this significantly helps performance.
So in this situation I would not spend a lot of time attempting to optimize the performance of the screen by only repainting the changed parts.
09-07-2010 06:42 PM
Thank you for the helpful pointers. Going to check out the tabbed example and
see if it can be adapted for my needs.
Will post back soon with the results.