public class TextOverlay extends Object implements Renderer2d
TextOverlay allows computing the 2d position of a text in the window, according to its required position
in the 3d environment (using appenText method).
As a 2nd pass, it might be rendered into a java Graphics context. The interesting thing, compared to the
currently used TextBitmapRenderer, is that the user may select any java Font, whereas the TextBitmapRenderer
only relies on Helvetica font provided by opengl.
Actually no need to urgently correct these following todo: due to the problems related to post/pre rendering (blinking),
this text Renderer is not used. An alternative would be to render the java text could be renderer into a Java Image
that could in turn be rendered by opengl.
// TODO: Verify alignement constants
// TODO: Complete text renderer: select font, size, zoom
// TODO: there may be a bug of non-rendering without resizing at init -> check that
// TODO: the 1<->N relation TextRenderer<->Canvas won't work because TextRenderer has only one target Component.| Constructor and Description |
|---|
TextOverlay(ICanvas canvas) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendText(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam,
String s,
Coord3d position,
Halign halign,
Valign valign,
Color color) |
void |
dispose() |
protected void |
init(ICanvas canvas) |
protected void |
initComponent(Component c) |
void |
paint(Graphics g) |
public TextOverlay(ICanvas canvas)
protected void init(ICanvas canvas)
protected void initComponent(Component c)
public void dispose()
public void appendText(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam,
String s,
Coord3d position,
Halign halign,
Valign valign,
Color color)
public void paint(Graphics g)
paint in interface Renderer2dCopyright © 2016. All rights reserved.