1

I'm working on my first game and I'm a bit stuck. I cannot for the life of me figure out how to create a UI or HUD. What I am trying to do is get the game screen to take up about 75% of the screen and an overlay with buttons to purchase things to take up the other 25% of the screen. The game itself would be full screen.

I have looked for game tutorials to see if I could see how it was done there but I am not having any luck. I have considered how framelayout might work but can't quite grasp the concept. Any help or a direction on where to go to find an answer would be appreciated.

Droid
  • 65
  • 1
  • 9
  • 2
    What kind of game? Are you using a game engine of any kind or hand coding everything? How are you drawing your game objects? – Fraggle Jul 10 '12 at 21:30
  • I'm not working with any sort of engine right now. I took the skeleton for MainPanel and MainThread from [here](http://www.javacodegeeks.com/2011/07/android-game-development-game-idea.html). – Droid Jul 11 '12 at 00:33
  • 1
    While I've just started "playing" with the Unity3d engine, I think there is a lot more that can be done using such an engine vs hand coding. Of course hand coding it you will learn a ton more, so there is that, but your chances of making a killer game are far less than if you use an engine. IMO – Fraggle Jul 11 '12 at 01:00
  • I think what you said is accurate. Since this is my first game I want to see how it's done so I know more what I'm doing if I ever decide to get more in depth and use an engine. I know that I am missing something with this and can't quite figure out how to do it properly. – Droid Jul 11 '12 at 02:10
  • I would suggest coding from hand. You're not going to learn much about how to program for games by using Unity. Plus Unity has a lot of limitations that you can't just code around. – Brad Jul 11 '12 at 02:24
  • 1
    @Geoff, but chances for burnout are greater I think when coding from hand. I mean if your goal is to be an expert programmer, then that is definitely the way to go, but if your goal is to deliver/publish/sell a great game, then I'm not so sure. – Fraggle Jul 11 '12 at 13:58
  • I'm not trying to be a dick, but how many games developed using Unity are known as Great Games? – Brad Jul 12 '12 at 00:58
  • If I do end up using an engine at some point what would you recommend? I have heard some things about AndEngine but that's about it. – Droid Jul 13 '12 at 17:05

1 Answers1

0

This article is very useful.

http://mobile.dzone.com/articles/beginning-android-game

Before trying to create a HUD or anything like that, make a character that animates and that you can move around the screen.

ie. tap a location, the character walks to it.

From there, the HUD, GUI etc. will make more sense.

Brad
  • 9,113
  • 10
  • 44
  • 68
  • I understand the concepts put forth in the link you gave. However, I am still having difficulty with the question I asked. – Droid Jul 11 '12 at 00:43
  • You should be rendering everything within your SurfaceView without mucking about using FrameLayouts or anything else. Basically you want to use the entire screen to render things manually. After that you need to create your own custom solution to rendering HUD, GUI etc. – Brad Jul 11 '12 at 01:33
  • I am rendering everything now in SurfaceView as you said. I assumed there was some easy/standard way to use some sort of overlay to add a menu. For example, Frame1 shows the map on most of the screen while Frame 2 shows actions that can be pushed for events. Simply stack Frame1 on Frame2 and profit. From what I understand you saying, I should manually draw the menu at the bottom while drawing the map at the top. Do I understand you correctly? – Droid Jul 11 '12 at 02:14
  • Would you agree that what you're trying to do is render things in layers? If that's what you're trying to do, then try to apply this in an OO sense. ie. Have a Layer class and another class that handles them, maybe LayerStack for instance? – Brad Jul 11 '12 at 02:23
  • I would agree with that. Layers is probably a better word to use instead of frames. Do you have any examples you might be able to link? – Droid Jul 11 '12 at 03:10
  • Not specifically. Just give it a shot. – Brad Jul 11 '12 at 03:46