de.grogra.imp3d.gl
public class TextRenderer3D extends java.lang.Object
| Constructor and Description |
|---|
TextRenderer3D(java.awt.Font font,
float depth)
Intstantiates a new TextRenderer3D initially rendering in the specified
font.
|
| Modifier and Type | Method and Description |
|---|---|
void |
call()
Draws the current compiled string, if any.
|
void |
call(int index)
Draws the specified compiled string, if any.
|
int |
compile(java.lang.String str)
Creates the specified string as a display list.
|
int |
compile(java.lang.String str,
float xOff,
float yOff,
float zOff,
float scaleFactor)
Creates the specified string as a display list.
|
void |
dispose()
Diposes of the ALL the current compiled shapes, if any.
|
void |
dispose(int index)
Diposes of the specified compiled shapes, if it is in the list.
|
void |
draw(java.lang.String str)
Renders a string into the specified GL object, starting at the (0,0,0)
point in OpenGL coordinates.
|
void |
draw(java.lang.String str,
float xOff,
float yOff,
float zOff,
float scaleFactor) |
java.awt.geom.Rectangle2D |
getBounds(java.lang.String str)
Get the bounding box for the supplied string with the current font, etc.
|
java.awt.geom.Rectangle2D |
getBounds(java.lang.String str,
float scaleFactor)
Get the bounding box for the supplied string for the current font and
specified scale factor.
|
boolean |
getCalcNormals()
Gets whether normals are being calculated
|
float |
getDepth()
Retrieves the z-depth used for this TextRenderer3D's text rendering.
|
float |
getFlatness()
Set the flatness to which the glyph's curves will be flattened
|
java.awt.Font |
getFont()
Retrieves the Font currently associated with this TextRenderer3D
|
boolean |
isFill()
Determines if the text is being rendered as filled polygons or
wireframes.
|
void |
setCalcNormals(boolean normals)
Sets whether the normals will eb calculated for each face
|
void |
setDepth(float depth)
Determines how long the sides of the rendered text is.
|
void |
setFill(boolean fill)
Sets if the text should be rendered as filled polygons or wireframe.
|
void |
setFlatness(float flatness)
Get the current flatness to which the glyph's curves will be flattened
|
void |
setFont(java.awt.Font font)
Specifies which font to render with this TextRenderer3D
|
public TextRenderer3D(java.awt.Font font,
float depth)
throws java.lang.NullPointerException
font - - the initial font for this TextRenderer3D
depth - the extruded depth for the fontjava.lang.NullPointerException - if the supplied font is nullpublic void call()
public void call(int index)
public int compile(java.lang.String str)
str - public int compile(java.lang.String str,
float xOff,
float yOff,
float zOff,
float scaleFactor)
str - xOff - yOff - zOff - scaleFactor - public void dispose()
public void dispose(int index)
public void draw(java.lang.String str)
str - the string to render.glu - a GLU instance to use for the text rendering (provided to
prevent continuous re-instantiation of a GLU object)gl - the OpenGL context in which to render the text.public void draw(java.lang.String str,
float xOff,
float yOff,
float zOff,
float scaleFactor)
public java.awt.geom.Rectangle2D getBounds(java.lang.String str)
str - public java.awt.geom.Rectangle2D getBounds(java.lang.String str,
float scaleFactor)
str - scaleFactor - public boolean getCalcNormals()
setNormalpublic float getDepth()
public float getFlatness()
public java.awt.Font getFont()
public boolean isFill()
public void setCalcNormals(boolean normals)
mode - the mode to render in. Default is flat.public void setDepth(float depth)
depth - specifies the z-size of the rendered 3D text. Negative numbers
will be set to 0.public void setFill(boolean fill)
fill - if true, uses filled polygons, if false, renderings are
wireframe.public void setFlatness(float flatness)
public void setFont(java.awt.Font font)
throws java.lang.NullPointerException
font - a font to use for rendering *java.lang.NullPointerException - if the supplied font is null