Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

Text2D Class Reference

Text2D represents 2D, screen-aligned text. More...

Inheritance diagram for Text2D:

Mesh EventHandler GeometryNode Node IGeometry Object List of all members.

Public Member Functions

virtual bool handleEvent (const Event &event)
 Callback function that is implemented by the callee.

Detailed Description

Text2D represents 2D, screen-aligned text.

Authoring Interface:

        Text2D {
            field   SFString    string      ""
            field   SFColor4f   color       Color.white
            field   SFString    alignment   "CENTER"
            field   SFString    font        "verdana12"
            field   SFInt32     width       -1
            field   SFInt32     height      -1
            field   SFInt32     maxWidth    -1
            field   SFInt32     maxHeight   -1
            field   SFBoolean   horizontal  true    // not implemented in V0.5
        }
Parameters:
string specifies the string to be displayed. Default value: ""
color specifies the color of the text to be displayed. Default value: Color.white
alignment specifies the horizontal adjustment of text, in relation to the origin in the local coordinate system. Possible values are: "LEFT", "CENTER", or "RIGHT". Default value: "CENTER"
verticalAlignment specifies the vertical adjustment of text, in relation to the origin in the local coordinate system. Possible values are: TOP aligns the CAPHEIGHT of the top line of text at translation.y BASELINE aligns the BASELINE of the first line of text at translation.y CENTER centers the vertical height of the text block at translation.y BOTTOM aligns the DESCENDER of the bottom line of text at translation.y Default value: "BASELINE"
font specifies the predefined screen font for the text. A table listing the predefined screen font names available is provided below. Default value: "verdana12"
width can be specified to scale the text to fit a desired width. A flag value of -1 indicates that the text should be displayed at its typeset width, without distortion. Default value: -1
height can be specified to scale the text to fit a desired height. A flag value of -1 indicates that the text should be displayed at its typeset height, without distortion. Default value: -1
maxWidth can be specified to break the string into multiple lines if it is more than maxWidth long. A flag value of -1 indicates that the text should be displayed as a single line. Default value: -1
maxHeight can be specified to specify maximum height for a text item. If text is multiline and and exceeds this limit, it is cut off. A flag value of -1 indicates that the text should be displayed at its normal height. Default value: -1
Functions:
getSetWidth(string)returns the width of the Text2d in world coordinates for the given string argument. For example: getSetWidth("Emma") returns 0.98 for a given Text2D node, which means the setwidth of this text in the local world coordinate space will be 0.98 units wide. This function can be used to elide a string to fit a predetermined world-coordinate length.

Functionality:

XXX To be written

Predefined screen font names include:

"gse4x6"
"gse4x8"
"gse5x7"
"gse5x9"
"gse6x9"
"gse6x12"
"gse7x11"
"gse7x11_bold"
"gse7x15"
"gse7x15_bold"
"gse8x16"
"gse8x16_bold"
"mcs11_prop"
"mcs11_prop_condensed"
"mcs12_prop"
"mcs13_prop"
"mcs5x10_mono"
"mcs5x11_mono"
"mcs6x10_mono"
"mcs6x11_mono"
"mcs7x12_mono_high"
"mcs7x12_mono_low"
"verdana12"
"verdana12_bold"
"verdana13"
"verdana13_bold"
"verdana14"
"verdana14_bold"
"verdana16"
"verdana16_bold"
"verdana17"
"verdana17_bold"
"verdana18"
"verdana18_bold"


Member Function Documentation

virtual bool handleEvent const Event event  )  [virtual]
 

Callback function that is implemented by the callee.

Parameters:
event specifies the time of the event. Event time will be the same for events occurring in the same render phase For example, PREUPDATE, POSTUPDATE, PRERENDER and POSTRENDER event callbacks will all pass the same event time for the same frame. Returning stop Emma from calling the rest of the handlers for this event If you return true, Emma will keep on calling rest of the handlers for this event

Implements EventHandler.


Generated on Sat Apr 1 06:08:09 2006 for Emma Content Development Kit by  doxygen 1.4.3