Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

Rt2dPickRegion
[Rt2d]


Functions

Rt2dObject Rt2dPickRegionCreate (void)
RwBool  Rt2dPickRegionDestroy (Rt2dObject *pickRegion)
Rt2dPath Rt2dPickRegionGetPath (Rt2dObject *pickRegion)
RwBool  Rt2dPickRegionIsPointIn (Rt2dObject *pickRegion, RwV2d *point)
Rt2dObject Rt2dPickRegionStreamWrite (Rt2dObject *pickRegion, RwStream *stream)
RwUInt32  Rt2dPickRegionStreamGetSize (Rt2dObject *pickRegion)
Rt2dObject Rt2dPickRegionStreamRead (RwStream *stream)

Detailed Description

Pick regions

Rt2dPickRegion Overview

A pick region is an invisible area on a screen. Pick regions can be used as buttons and clickable areas on a screen. Pick regions can also be used in conjunction with shapes and added to a scene.

Creating a Pick Region
  1. Rt2dPickRegionCreate creates the pick region.
  2. Rt2dPickRegionGetPath returns the path.
Adding PickRegions to Scenes
  1. Rt2dSceneLock locks the scene.
  2. Rt2dSceneAddChild adds the pick region to the scene.
  3. Rt2dSceneUnlock unlocks the scene.
See also:
Rt2dSceneCreate

Function Documentation

Rt2dObject* Rt2dPickRegionCreate void   
 

Rt2dPickRegionCreate creates a pick region object. To create a new pick region:

  1. Rt2dPickRegionCreate creates the pick region.
  2. Rt2dPickRegionGetPath creates the path.
Returns:
Returns the pick regions if successful, NULL otherwise.
See also:
Rt2dPickRegionDestroy , Rt2dPickRegionGetPath
RwBool Rt2dPickRegionDestroy Rt2dObject   object
 

Rt2dPickRegionDestroy Destroys a pick region object.

Parameters:
object  is the pick region to destroy.
Returns:
Returns TRUE if successful, FALSE otherwise.
See also:
Rt2dPickRegionCreate
Rt2dPath* Rt2dPickRegionGetPath Rt2dObject   pickRegion
 

Rt2dPickRegionGetPath Returns the local definition of the pick region path.

Parameters:
pickRegion  is the pickRegion to obtain the path from
Returns:
Returns the pick region path if successful, NULL otherwise.
See also:
Rt2dPickRegionIsPointIn , Rt2dPickRegionCreate
RwBool Rt2dPickRegionIsPointIn Rt2dObject   pickRegion,
RwV2d   point
 

Rt2dPickRegionIsPointIn Checks if a point is in the pick region. The last 'render' operation provides the background for the positioning of the pick region.

Parameters:
pickRegion  is the pickRegion to check the point against
point  is the point to check
Returns:
returns TRUE if the point is in the given pick region, FALSE otherwise
See also:
Rt2dPickRegionGetPath
RwUInt32 Rt2dPickRegionStreamGetSize Rt2dObject   pickRegion
 

Rt2dPickRegionStreamGetSize is used to determine the size in bytes of the binary representation of the given pick region. This value 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:
pickRegion  the pick region to obtain the size of
Returns:
Returns a RwUInt32 value equal to the chunk size (in bytes) of the shape, NULL otherwise.
See also:
Rt2dPickRegionStreamWrite , Rt2dPickRegionStreamRead
Rt2dObject* Rt2dPickRegionStreamRead RwStream   stream
 

Rt2dPickRegionStreamRead is used to read a pick region from the specified binary stream. Note that prior to this function call, a binary pick region chunk must be found in the stream using the RwStreamFindChunk API function.

The sequence to locate and read a pick region from a binary stream is as follows:

   RwStream *stream;
   Rt2dObject *newPickRegion;
  
   stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx");
   if( stream )
   {
       if( RwStreamFindChunk(stream, rwID_2DPICKREGION, NULL, NULL) )
       {
           newPickRegion = Rt2dPickRegionStreamRead(stream);
       }
  
       RwStreamClose(stream, NULL);
   }
Parameters:
stream  is the stream to read from
Returns:
returns the pick region on success, NULL otherwise
See also:
Rt2dPickRegionStreamWrite , Rt2dPickRegionStreamGetSize , RwStreamClose , RwStreamFindChunk
Rt2dObject* Rt2dPickRegionStreamWrite Rt2dObject   pickRegion,
RwStream   stream
 

Rt2dPickRegionStreamWrite is used to write the specified pick region to the given binary stream. Note that the stream will have been opened prior to this function call.

Parameters:
pickRegion  is the pickRegion to stream
stream  is the stream to write to
Returns:
returns the pick region on success, NULL otherwise
See also:
Rt2dPickRegionStreamGetSize , Rt2dPickRegionStreamRead , 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)