| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Shape3D com.sun.j3d.utils.geometry.Text2D
Text2D | public class Text2D extends Shape3D (Code) | | A Text2D object is a representation of a string as a texture mapped
rectangle. The texture for the rectangle shows the string as rendered in
the specified color with a transparent background. The appearance of the
characters is specified using the font indicated by the font name, size
and style (see java.awt.Font). The approximate height of the rendered
string will be the font size times the rectangle scale factor, which has a
default value of 1/256. For example, a 12 point font will produce
characters that are about 12/256 = 0.047 meters tall. The lower left
corner of the rectangle is located at (0,0,0) with the height
extending along the positive y-axis and the width extending along the
positive x-axis.
|
Constructor Summary | |
public | Text2D(String text, Color3f color, String fontName, int fontSize, int fontStyle) Creates a Shape3D object which holds a
rectangle that is texture-mapped with an image that has
the specified text written with the specified font
parameters. |
fontSizefontStyle | int fontSizefontStyle(Code) | | |
rectangleScaleFactor | float rectangleScaleFactor(Code) | | |
Text2D | public Text2D(String text, Color3f color, String fontName, int fontSize, int fontStyle)(Code) | | Creates a Shape3D object which holds a
rectangle that is texture-mapped with an image that has
the specified text written with the specified font
parameters.
Parameters: text - The string to be written into the texture map. Parameters: color - The color of the text string. Parameters: fontName - The name of the Java font to be used forthe text string. Parameters: fontSize - The size of the Java font to be used. Parameters: fontStyle - The style of the Java font to be used. |
getColor | public Color3f getColor()(Code) | | Returns the color of the text
since: Java 3D 1.2.1 |
getFontName | public String getFontName()(Code) | | Returns the font
since: Java 3D 1.2.1 |
getFontSize | public int getFontSize()(Code) | | Returns the font size
since: Java 3D 1.2.1 |
getFontStyle | public int getFontStyle()(Code) | | Returns the font style
since: Java 3D 1.2.1 |
getRectangleScaleFactor | public float getRectangleScaleFactor()(Code) | | Gets the current scale factor being used in converting the image
width/height to width/height values in 3D.
The current scale factor. |
getString | public String getString()(Code) | | Returns the text string
since: Java 3D 1.2.1 |
setRectangleScaleFactor | public void setRectangleScaleFactor(float newScaleFactor)(Code) | | Sets the scale factor used in converting the image width/height
to width/height values in 3D.
Parameters: newScaleFactor - The new scale factor. |
|
|