Version 3.0 of the Web Driver adds the ability to create and modify 3d text objects in script, exposed through the WTString3D object.
While you could certainly create your own 3d text in 3dsmax or other modeling tools, the Web Driver's 3d text is much simpler to use, and more importantly
for web-based content, creates text without needing to download any geometry files.
Prior to Web Driver 3.0, 3d text objects were only available in WTStudio.
The WTString3D object gives you access to the following text properties:
The text string used to create the string mesh. Note that 3d text is all on a single line; wrapping text or newline characters are not supported.
The font to be used. This will be the Windows font name, but Windows allows some leeway when specifying common fonts (such as using "Times" for
"Times New Roman" above). Note that when you specify the font, you also need to specify the correct character
set to use. This will be 0 for most fonts. In the lab above, all of the fonts use character set 0 except Wingdings, which uses the Symbol character set (2).
See the documentation for WTFont:setTextProperties() for more details on character sets.
Properties inherited from WTGroup, such as position, orientation, scale, collision mask, visibility, etc.
The position, orientation, and scale of the individual characters in the string (which the API calls "glyphs"). When initially created, the 3d text object
has a base height and depth of 72 units, but the actual character height may be different, as in the case of lower case characters and such. To move or
rotate the letters in reference to their original positions in the string, use setGlyphRelativePosition() and setGlyphRelativeOrientation.
To scale the individual letters, or to transform them in world coordinates, obtain a reference to the glyph with getChildByIndex(), and apply the
transforms to the returned object.
Bold and italics.
The text quality, which refers to how coarse a mesh is used to create the letters. The higher the quality, the greater the polycount of the letters.
The mesh color.
The texture or surface shader applied to the mesh. When applying a texture or shader, you can choose to apply it to the front, sides, or back of the text object, or
simply apply it to the entire model.
This lab demonstrates how to set various properties of the 3d text object, as well as how to change the positions of individual letters. Use the controls
to the right of the Web Driver window to adjust properties of the 3d text, or click and drag individual letters to change their positions. If you wish to
examine the effects of setting text quality, pressing space while the web driver window has focus will toggle wireframe mode. To rotate the 3d text object,
left click and drag in the scene (in a spot where there are no letters). Right click and drag to zoom.
When any function is called that changes the glyphs in the object (setText(), setTextProperties(), and setTextFace()), the transforms of the
individual glyphs are discarded (that is, the letters are re-initialized in their default positions). If references to the individual objects have been obtained using
getChildByIndex(), these references will no longer be valid, and should be released by setting them to null.
The font face used for creating the glyphs will be dependent on the font being present on the user's system. If none of the requested fonts are present,
the string will be constructed using the Arial font.
The lowest level accessible object in the letter hierarchy is actually the front, sides, or backs of the letters, rather than the letters themselves- so,
if letters are picked or otherwise collided with, the side, front, or back of an individual letter will be returned as the hit or picked object. The letter
itself can be obtained by calling getOwner() on this returned object.
In addition to creating WTString3D objects in code, you can also obtain them by extracting them from WTStudio levels using getChildByIndex() or
getObjectByName.