You can take a look at the Demos API project, which comes with sample Android SDKs. There is an OpenGL Sprite Text sample that does exactly what you want.
You can see the demo by installing the Demos API on an emulator (or device) and going to: Demos API> Graphics> OpenGL ES> Sprite Text
Here is a screenshot:

The text in the lower right corner of the screen changes on each frame in the onDrawFrame method of the renderer.
You can find the source code in the Android SDK sample directory: ApiDemos \ SRC \ COM \ e.g. \ Android \ APIs \ graphics \ spritetext
You will need to copy a few files into your project, and with very few lines of code you can achieve the same functionality.
Sample application : I created a sample application to demonstrate it by reusing code from the Demos API project. You can get it from here - OpenGLText_eclipse_project.zip
In short, you can fully use Grid.java, LabelMaker.java, NumericSprite.java. Then add a few lines of code to your Renderer to use the above classes as shown in my TextRenderer.java
Here's what it looks like with an updated score.

Basically, rendering an estimate is as simple as this:
LabelMaker mLabels = new LabelMaker(); mLabels.initialize(gl); mLabels.beginAdding(gl); int mLabelMsPF = mLabels.add(gl, "Score:", mLabelPaint); mLabels.endAdding(gl); mLabels.beginDrawing(gl, mWidth, mHeight); mLabels.draw(gl, 0, 0, mLabelMsPF); mLabels.endDrawing(gl); NumericSprite mNumericSprite = new NumericSprite(); mNumericSprite.setValue(16); mNumericSprite.draw(gl, 0, 0, mWidth, mHeight);
appsroxcom
source share