Indeed, positioning does become an issue with FrameLayout. I'm not sure whether or not it's an acceptable thing to do for games, as it's certainly my first. Positioning is really important for my game, even down to pixels and so I've had to come up with a lot of math to figure out the correct placements for everything in the game scene. Again, not sure if it's the accepted approach but thus far it has worked out fine. I'll need to do some extensive testing across various devices to verify everything however.
What I have is a view that takes up the entire screen. It's a custom view that handles all of the drawing of the components that make up the game. Most of those components are drawables. I'm in need of a TextView that I can access from my custom view to give the user feedback as the game progresses. The LunarLander (Landing?) game that comes with the SDK has a nice way of doing this, and as such I've adopted the method in my game. However, when it comes to the positioning of the TextView, it takes the center of the screen approach. What I want to do is contain my TextView in a layout of some kind, and confine that layout to the bottom of the screen at all times. Think of a status bar in your browser as an example. I've done this before in another app of mine but I suppose the circumstances were slightly different. Instead of layering a layout on top of one that takes up the entire UI, I'm using relative layouts. I've yet to find a way to do this in the context of my game. Thanks for your reply Mark. Even just typing that response out myself helps me wrap my head around the problem better. -- Chris Stewart http://chriswstewart.com Fantasy Football<http://chriswstewart.com/android-applications/fantasy-football/>- Android app for MFL fantasy football owners Fantasy Football Insider<http://chriswstewart.com/android-applications/fantasy-football-insider/>- Android app for all fantasy football fanatics Social Updater<http://chriswstewart.com/android-applications/social-updater/>- An easy way to send your status blast to multiple social networks On Mon, Aug 23, 2010 at 5:40 PM, Mark Murphy <[email protected]>wrote: > I don't follow your scenario. That being said, I recommend > RelativeLayout for overlapping views. The people using FrameLayout for > this role are either stuck with everything in the upper-left corner or > will have maintenance problems with multiple screen sizes. > > On Mon, Aug 23, 2010 at 5:16 PM, Chris Stewart <[email protected]> > wrote: > > I'm working on a game and have a scenario where I want to overlay a > layout > > containing a TextView on top of my game canvas for status updates, and so > > on. I guess the catch is that I want the layout to be locked at the > bottom > > of the screen (horizontal) at all times. I've done this for my fantasy > > football app, but there I was using a LinearLayout where every game > sample I > > saw used a FrameLayout which I ended up going with as well. > > I'm likely just missing some fundamental understanding of the various > layout > > options. But, given my scenario as described, what combination of > layouts > > would you use? > > > > -- > > Chris Stewart > > http://chriswstewart.com > > Fantasy Football - Android app for MFL fantasy football owners > > Fantasy Football Insider - Android app for all fantasy football fanatics > > Social Updater - An easy way to send your status blast to multiple social > > networks > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected]<android-developers%[email protected]> > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.1 Available! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

