0

THis is a follow up question to my other one shown here

basically me and my undergraduate project group are creating a 2D graphing application in opengl es 2.0 where the user can enter an equation of a line and have it plot onto the screen. As shown here sin(x) plot

So basically I want to add a numerice scale[-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10] onto the x and y axis and also label the x and y axis with an "X" and "Y". Basically I have now determined that a textView on top of my GLSURFACEVIEW may be the simplest way to achieve this. Anyone have a link to a tutorial or could help me start coding this view and setting text in there appropriate positions like this:I need a textView that will display the numbers like this

How would I code a textView to display the numeric scale and X and Y labels?

Community
  • 1
  • 1

1 Answers1

0

I would create a View on top of GLSurfaceView instead of adding textview, which would cover whole GLSurfaceView.

You can use onDraw(Canvas canvas) to draw the scale using drawText method.

Mani
  • 186
  • 5