AsciiText


Purpose:
This node is one of the eight shape Nodes. Use this node to display text in the VRML world. This node allows for the representation of text string characters from the ASCII coded character set to be displayed on the screen.
Syntax

JUSTIFICATION

LEFT Align left edge of text to origin LEFT (the default) places the left edge of each string at x=0.

CENTER Align center of text to origin. CENTER places the center of each string at x=0.

RIGHT Align right edge of text to origin. RIGHT places the right edge of each string at x=0.

 

FILE FORMAT/DEFAULTS

AsciiText {

	string		""	# MFString
	spacing		1	# SFFloat
	justification	LEFT	# SFEnum
	width		0	# MFFloat
}
Explanation

string: This is the group of characters you wish displayed

spacing: The first string, or group of characters, is rendered with its baseline at (0,0,0). All of the strings that follow are advanced along the y-axis by the formula -(size * spacing). Size is specified by the height (in object space units) of the glyphs rendered. This determines the vertical spacing of the adjacent lines of text.

justification: This field determines the where the strings will be placed along the x-axis. The character string is rendered from left to right, top to bottom in the font set by FontStyle.

width: This field defines a suggested width constraint for each string. The default, 0, is to use the natural width of each string.

The character string is transformed according to the current cumulative transformation of the parent node. The string is drawn with the current material and texture.

The texture begins at the origin of the first string, as determined by the current justification. The texture is then scaled in both S and T dimensions equally. The font height represents one unit. S increases to the right. The origin of T can occur anywhere along each character of the string depending on how that specific character's outline is defined.

Example Use

The following code fragment is from Allnodes.wrl.

AsciiText {
	string		[ "Hello", "there" ]
	spacing		1
	justification	LEFT
	width		0
}
See Also

FontStyle