3ds Max C++ API Reference
ITextObject Class Referenceabstract

#include <istdplug.h>

+ Inheritance diagram for ITextObject:

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
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

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

Member Function Documentation

◆ ChangeText()

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.

◆ ChangeFont()

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.

◆ GetFont()

virtual MSTR GetFont ( )
pure virtual
Remarks
Returns the name of the text font.

◆ GetString()

virtual MSTR GetString ( )
pure virtual
Remarks
Returns the text string.

◆ GetItalic()

virtual BOOL GetItalic ( )
pure virtual
Remarks
Returns TRUE if the text is italicized; otherwise FALSE.

◆ GetUnderline()

virtual BOOL GetUnderline ( )
pure virtual
Remarks
Returns TRUE if the text is underlined; otherwise FALSE.

◆ SetItalic()

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.

◆ SetUnderline()

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.

◆ SetAlignment()

virtual BOOL SetAlignment ( int  type)
pure virtual

◆ GetAlignment()

virtual int GetAlignment ( )
pure virtual