Basically the question is in the title.

I'm creating a RTS game and I will need buttons like attack move / attack ground, etc. I am not using any engine.

When people do games in OpenGL for android (my case), do they ever use android components to control the game or do they create their components in the game? What are the general recommended approach, if there's any? How about more complex components like scrolling lists of items , etc? I would also appreciate you to pair your answer with a brief comment about how was your experience using the approach(es) you describe.

Thanks :)

  • \$\begingroup\$ I would say create your own set of UI controls. This way you can easier theme them, add effects to them, etc. But this is just based on my experience, and I've done very little android programming. \$\endgroup\$ – hayer Sep 26 '12 at 6:27

You can add your controls using ImageView, View to your SurfaceView like if this one was a RelativeLayout.

With this method you will easily track touchEvent, OnClick etc...

Well this is how I do for my game and it works well !

NB: I didn't try with ListView etc... but if you customize its UI to have the same look as your game I don't see where the problem can be.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.