Public Member Functions

ITextObject Class Reference

Search for all occurrences

Detailed Description

See also:
Class Animatable.

Description:
This is the text shape object interface. This class gives access to the standard 3ds Max text object. It allows the text objects font, string, and style bits to be retrieved and set. All methods of this class are implemented by the system.

To get a pointer to an ITextObject interface given a pointer to a object, use the following macro (defined in AnimatableInterfaceIDs.h ). Using this macro, given any Animatable, it is easy to ask for the text object interface.

#define GetTextObjectInterface(anim)

((ITextObject*)anim->GetInterface(I_TEXTOBJECT))

A plug-in developer may use this macro as follows:

ITextObject *ito = GetTextObjectInterface(anim);

This return value will either be NULL or a pointer to a valid text object interface. You may then use this pointer to call methods of this class to retrieve and modify the object data. For example:

ito->SetUnderline(TRUE);

Note: Some aspects of the text are controlled by its parameter block. Developers can access the parameter block by calling ito->GetParamBlock(). The following are the indices into the parameter block used to access the size, kerning and leading parameters:

TEXT_SIZE

TEXT_KERNING

TEXT_LEADING

#include <istdplug.h>

Inheritance diagram for ITextObject:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual BOOL  ChangeText (MSTR string)=0
virtual BOOL  ChangeFont (MSTR name, DWORD flags)=0
virtual MSTR  GetFont ()=0
virtual MSTR  GetString ()=0
virtual BOOL  GetItalic ()=0
virtual BOOL  GetUnderline ()=0
virtual void  SetItalic (BOOL sw)=0
virtual void  SetUnderline (BOOL sw)=0
virtual BOOL  SetAlignment (int type)=0
virtual int  GetAlignment ()=0

Member Function Documentation

virtual BOOL ChangeText ( MSTR  string ) [pure virtual]
Remarks:
This method may be called to change the text string. Note that you can't change the string if the current font is not installed.
Parameters:
MSTR string

The new text string.
Returns:
TRUE if the string is changed; otherwise FALSE.
virtual BOOL ChangeFont ( MSTR  name,
DWORD  flags 
) [pure virtual]
Remarks:
This method may be called to change the text font.
Parameters:
MSTR name

The name of the font.

DWORD flags

One or more of the following values:

TEXTOBJ_ITALIC

TEXTOBJ_UNDERLINE
Returns:
TRUE if the font was successfully changed; otherwise FALSE.
virtual MSTR GetFont ( ) [pure virtual]
Remarks:
Returns the name of the text font.
virtual MSTR GetString ( ) [pure virtual]
Remarks:
Returns the text string.
virtual BOOL GetItalic ( ) [pure virtual]
Remarks:
Returns TRUE if the text is italicized; otherwise FALSE.
virtual BOOL GetUnderline ( ) [pure virtual]
Remarks:
Returns TRUE if the text is underlined; otherwise FALSE.
virtual void SetItalic ( BOOL  sw ) [pure virtual]
Remarks:
Sets if the text is italicized or not.
Parameters:
BOOL sw

TRUE if the text should be italicized; FALSE if not.
virtual void SetUnderline ( BOOL  sw ) [pure virtual]
Remarks:
Sets if the text is underlined or not.
Parameters:
BOOL sw

TRUE if the text should be underlined; FALSE if not.
virtual BOOL SetAlignment ( int  type ) [pure virtual]
virtual int GetAlignment ( ) [pure virtual]

ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject
ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject ITextObject