Author Topic: Menu System  (Read 5506 times)

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Menu System
« on: February 24, 2011, 02:33:56 pm »
Hi,

for an android game what do people suggest is the best way to create a menu system?

1) A separate android activity with button widgets etc (isolated from jpct-ae)
2) Blitting a full menu via jpct-ae
3) 3d objects with a camera facing them head on
4) Any other suggestions?

Im not looking for any example code or anything like that, Im just curious as to what is the general method for developing a menu system for a jpct-ae game so that I can start investigating that method without wasting time on something which people may know to be a dead end.

Many thanks

Offline tyronetudehope

  • byte
  • *
  • Posts: 7
    • View Profile
Re: Menu System
« Reply #1 on: February 24, 2011, 03:34:22 pm »
What I'm doing is building menu or UI "components" that can then be blitted to the screen. For text blitting I'm using a slightly modified version of r.a.f.t's GLFont and TexturePack, @raft, I hope this is OK ???. And for the menu item containers, I'm just using dynamically created bitmaps of whatever colour the dev would like his/her menu to be. Am also using TexturePack for this. Then simply handle the click events by polling the click coords with the coords of each menu item and fire your own custom event.

I also thought about having an activity for handling menu operations, however, it made more sense to me to have an OpenGL based menu, whereby, you could, for example display a pause menu over your scene and will allow you to add screen controls to your game, like pause, change weapons, etc.

I hope this helps, it will be interesting to hear other ideas also, I'm sure there maybe better solutions to this.

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Menu System
« Reply #2 on: February 24, 2011, 03:43:11 pm »
Thanks for your reply. I have been thinking about blitting as being my number 1 option as well. I currently for test purposes have an activity with some buttons on it to load different levels but you cant really do much with that kind of menu system and I don't like popping in and out of activities.

So right now, I reckon I will probably do something similar to what you spoke about. Would be nice to have some sort of framework built around blitting for a menu system that would be reusable.

Offline tyronetudehope

  • byte
  • *
  • Posts: 7
    • View Profile
Re: Menu System
« Reply #3 on: February 24, 2011, 04:04:17 pm »
Essentially, I'm trying to develop a GUI framework for jPCT, thats as customizable as possible. However, am only in early stages of this. Once the framework starts to take shape, I'll open up the source :)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Menu System
« Reply #4 on: February 24, 2011, 04:06:50 pm »
@raft, I hope this is OK ???.
sure, they are meant for this ;)

i myself blit images and in game-texts with TexturePack and GLFont. but for menu's i use Android's gui elements, not in another activity but as semitransparent components over GL surface view. you can see screenshots here. (there seem to be a problem with imageshack so some of teh screenshots are not visible at the moment)
http://www.jpct.net/forum2/index.php/topic,1760.0.html

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Menu System
« Reply #5 on: February 24, 2011, 04:22:10 pm »
That game looks pretty damn awesome raft  :)

So all the individual in game objects are blits yes? But the menu screen at the bottom of the page is the android ui stuff? This is an interesting approach. So is this done by having a layout view that is just set to invisible unless its needed or do you render the components on the fly?

I know its not exactly part of this thread but Im interested in the control system in the bottom right of the pictures. Can you give me an overview of how that works? Even just a high level understanding. I have seen similar controls in various games but I wasn't sure how it was implemented. Are you just picking up touch co-ordinates or how does it work?

btw, Is it on the market yet? I searched for it but didnt find anything that looks like this?

Thanks

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Menu System
« Reply #6 on: February 24, 2011, 04:49:31 pm »
thanks  :D

yes menu is made invisible during game. it's much easier to make a gui in android.

soft joystick works this way: user puts his thumb on it (exact position doesn't matter ) and slide to desired direction. I do the movement based on distance between touch point and slide point

jumpy is not complete and not in market yet. but you can download development version from the link in that thread

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Menu System
« Reply #7 on: March 04, 2011, 01:18:29 pm »
Hi Raft. Im now using your method for my menu system and its working out very well for me so thanks again for the suggestion.

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Menu System
« Reply #8 on: March 04, 2011, 01:20:42 pm »
i'm glad it helped :D i final note, make your view GONE instead of INVISIBLE. according to my tests it performs better

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: Menu System
« Reply #9 on: March 04, 2011, 01:40:15 pm »
and... done :)