Hi!
Is it possible to draw Android Controls on top of GLSurfaceView?
any examples?

Hachaso wrote:Hi!
Is it possible to draw Android Controls on top of GLSurfaceView?
any examples?

Hachaso wrote:Do you mean that I should to this with XML?
How is this done with JAVA coding?





mb_zi wrote:it might not be what you're after... but you could make a button in in open gl via a textured quad. all you need to do is check if the user presses in a certain x and y bounded area aka on the textured quad and if so change textures briefly (whilst the person is pressing in the right area) and do what you want it to achieve in the surface view.
e.g. if your button textured quad fills the bottom 8% of the screen from left to right. using below would check if the user presses within the button area.Using java Syntax Highlighting
public boolean onTouchEvent(MotionEvent event) { //Gets current x and y coordinates float x = event.getX(); float y = event.getY(); //If someone touches the screen and moves if(event.getAction() == MotionEvent.ACTION_MOVE) { int upperArea = this.getHeight() / 8; int lowerArea = this.getHeight() - upperArea; if(y > lowerArea) { //BUTTON STUFF HERE } } return true; }Parsed in 0.032 seconds, using GeSHi 1.0.8.4

Return to Android 2D/3D Graphics - OpenGL Tutorials
Users browsing this forum: No registered users and 1 guest