Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

Rt2dObjectString
[Rt2d]


Functions

Rt2dObject Rt2dObjectStringCreate (const RwChar *textString, const RwChar *font)
RwBool  Rt2dObjectStringDestroy (Rt2dObject *object)
Rt2dBrush Rt2dObjectStringGetBrush (Rt2dObject *object)
RwChar Rt2dObjectStringGetText (Rt2dObject *object)
RwChar Rt2dObjectStringGetFont (Rt2dObject *object)
RwReal  Rt2dObjectStringGetHeight (Rt2dObject *object)
Rt2dObject Rt2dObjectStringSetBrush (Rt2dObject *object, Rt2dBrush *)
Rt2dObject Rt2dObjectStringSetText (Rt2dObject *object, const RwChar *text)
Rt2dObject Rt2dObjectStringSetFont (Rt2dObject *object, const RwChar *font)
Rt2dObject Rt2dObjectStringSetHeight (Rt2dObject *object, const RwReal height)
Rt2dObject Rt2dObjectStringRender (Rt2dObject *object)
Rt2dObject Rt2dObjectStringStreamRead (RwStream *stream)
Rt2dObject Rt2dObjectStringStreamWrite (Rt2dObject *object, RwStream *stream)
RwUInt32  Rt2dObjectStringStreamGetSize (Rt2dObject *object)

Detailed Description

String functions

Rt2dObjectString Overview

An object string is an object which contains text. An object string can be saved and added to a scene.

Creating an Object String
  1. Rt2dObjectStringCreate creates the scene.
  2. Rt2dObjectStringGetBrush returns a brush used for rendering a string..
Adding an Object String to a Scene
  1. Rt2dSceneLock locks the scene.
  2. Rt2dSceneAddChild adds the object string to the scene.
  3. Rt2dSceneUnlock unlocks the scene.
See also:
Rt2dSceneCreate

Function Documentation

Rt2dObject* Rt2dObjectStringCreate const RwChar   textString,
const RwChar   font
 

Rt2dObjectStringCreate creates a new object string. The font is identified by name, and gets looked up from the font dictionary

Parameters:
textString  Pointer to the text string to be used
font  Pointer to a font
Returns:
Returns the new object string on success, NULL otherwise
See also:
Rt2dObjectStringDestroy , Rt2dObjectStringGetBrush
RwBool Rt2dObjectStringDestroy Rt2dObject   object
 

Rt2dObjectStringDestroy Deallocates the provided ObjectString

Parameters:
object  is the object string to be destroyed
Returns:
returns TRUE on success; FALSE otherwise
See also:
Rt2dObjectStringCreate
Rt2dBrush* Rt2dObjectStringGetBrush Rt2dObject   object
 

Rt2dObjectStringGetBrush Returns the brush owned by the object string

Parameters:
object  is the object string to get the brush from
Returns:
returns the brush if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringSetBrush
RwChar* Rt2dObjectStringGetFont Rt2dObject   object
 

Rt2dObjectStringGetFont Returns the pointer to the name of the font used by the object string

Parameters:
object  is the object string to get the brush from
Returns:
returns the font if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringSetFont , Rt2dObjectStringGetText , Rt2dObjectStringSetText
RwReal Rt2dObjectStringGetHeight Rt2dObject   object
 

Rt2dObjectStringGetHeight Returns the height used to render the object string

Parameters:
object  is the object string to get the brush from
Returns:
returns the height if successful
See also:
Rt2dObjectStringCreate , Rt2dObjectStringSetHeight
RwChar* Rt2dObjectStringGetText Rt2dObject   object
 

Rt2dObjectStringGetText Returns the pointer to the text of the object string

Parameters:
object  is the object string to get the brush from
Returns:
returns the text if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringSetText , Rt2dObjectStringGetFont , Rt2dObjectStringSetFont
Rt2dObject* Rt2dObjectStringRender Rt2dObject   object
 

Rt2dObjectStringRender Renders a string object. If an object string is part of a scene, the Rt2dSceneRender renders all visible objects.

Parameters:
object  the string to be rendered
Returns:
returns the object string that was rendered
See also:
Rt2dObjectStringCreate , Rt2dSceneRender
Rt2dObject* Rt2dObjectStringSetBrush Rt2dObject   object,
Rt2dBrush   brush
 

Rt2dObjectStringSetBrush Sets the brush used by the object string.

Parameters:
object  is the object string of which to change the text
brush  is the brush that's copied into the string
Returns:
returns the object string if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringGetBrush , Rt2dObjectStringGetText , Rt2dObjectStringSetText
Rt2dObject* Rt2dObjectStringSetFont Rt2dObject   object,
const RwChar   font
 

Rt2dObjectStringSetFont Sets the font used to render the object string.

Parameters:
object  is the object string of which to change the font
font  is the new font to be used
Returns:
returns the object string if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringGetFont , Rt2dObjectStringGetText , Rt2dObjectStringSetText
Rt2dObject* Rt2dObjectStringSetHeight Rt2dObject   object,
const RwReal    height
 

Rt2dObjectStringSetHeight Sets the characters height used to render the object string.

Parameters:
object  is the object string of which to change the font
height  is the new height to be used
Returns:
returns the object string if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringGetHeight
Rt2dObject* Rt2dObjectStringSetText Rt2dObject   object,
const RwChar   text
 

Rt2dObjectStringSetText Sets the text string within the object string.

Parameters:
object  is the object string of which to change the text
text  is the text that's copied into the string
Returns:
returns the object string if successful, NULL otherwise
See also:
Rt2dObjectStringCreate , Rt2dObjectStringGetText , Rt2dObjectStringGetFont , Rt2dObjectStringSetFont
RwUInt32 Rt2dObjectStringStreamGetSize Rt2dObject   object
 

Rt2dObjectStringStreamGetSize is used to determine the size in bytes of the binary representation of the given object string. This is used in the binary chunk header to indicate the size of the chunk. The size does include the size of the chunk header.

Parameters:
object  Pointer to the object.
Returns:
Returns a RwUInt32 value equal to the chunk size (in bytes) of the object string
See also:
Rt2dObjectStringStreamRead , Rt2dObjectStringStreamWrite
Rt2dObject* Rt2dObjectStringStreamRead RwStream   stream
 

Rt2dObjectStringStreamRead Reads an object string from a stream. Note that prior to this function call, a binary shape chunk must be found in the stream using the RwStreamFindChunk API function.

The sequence to locate and read an object string from a binary stream is as follows:

   RwStream *stream;
   Rt2dObject *new2dObjectString;

   stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx");
   if( stream )
   {
       if( RwStreamFindChunk(stream, rwID_2DOBJECTSTRING, NULL, NULL) )
       {
           new2dObjectString = Rt2dObjectStringStreamRead(stream);
       }

       RwStreamClose(stream, NULL);
   }
Parameters:
stream  is the stream to obtain the object string from
Returns:
returns the new object string
See also:
Rt2dObjectStringStreamWrite , Rt2dObjectStringStreamGetSize , RwStreamOpen , RwStreamClose , RwStreamFindChunk
Rt2dObject* Rt2dObjectStringStreamWrite Rt2dObject   object,
RwStream   stream
 

Rt2dObjectStringStreamWrite Writes an object string to a stream. Note that the stream will have been opened prior to this function call.

Parameters:
object  is the string to write to the stream
stream  is the stream to write the object string to
Returns:
if successful, returns the object string written, otherwise NULL
See also:
Rt2dObjectStringStreamGetSize , Rt2dObjectStringStreamRead , RwStreamOpen , RwStreamClose

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:48 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)