I was looking for introductory 2D selection in OpenGL ES in Stack Overflow. I mainly see questions about 3D.
I am developing a 2D level editor on Android 4.0.3 using OpenGL ES. The level editor has a 2D, yellow, square object located in the center of the screen. All I wanted to do was determine if the object was affected by the user.

There is no tile overlap in the level editor. Instead, they are placed side by side, like two adjacent pixels in a bitmap in MS Paint. My goal is to individually define a touch event for each square object in the level editor.
The object is created using a simple vertex array and uses GL_TRIANGLES to draw 2 flat right-angled triangles. There is no manipulation and no loading from a file or anything else. The only thing I know is that if the user touches any of the yellow triangles, then both yellow triangles must be selected.
Can someone tell us how I need it? Thanks in advance.
EDIT:
This is the draw() function:
public void draw(GL10 gl) { gl.glPushMatrix(); gl.glTranslatef(-(deltaX - translateX), (deltaY - translateY), 1f); gl.glColor4f(1f, 1f, 0f, 1f);
EDIT 2:
I still lack information. Do you use a camera? or clicking on other matrices before rendering the model ?. For example, if you use a spelling camera, you can easily remove the project screen coordinates [x_screen, y_screen] like this (y is similar):
I do not use a camera, but I probably use spelling projection. Again, I do not know, because I just use the general OpenGL function. I click and pop up matrices because I plan to integrate many tiles (square 2D objects) with different translation matrices. No two tiles will have the same translation matrix M.
Is perspective projection the same as spelling projection when it comes to 2D? I do not see the difference between the two.
Here's the initial setup when creating a surface (a class extending GLSurfaceView and implementing GLSurfaceView.Renderer ):
public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); } public void onSurfaceCreated(GL10 gl, EGLConfig arg1) { reset(); } public void onDrawFrame(GL10 gl) { clearScreen(gl); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0f, super.getWidth(), 0f, super.getHeight(), 1, -1); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); canvas.draw(gl); } private void clearScreen(GL10 gl) { gl.glClearColor(0.5f, 1f, 1f, 1f); gl.glClear(GL10.GL_COLOR_BUFFER_BIT); }