Rt2dMessage is a message structure that is used to coordinate animation sequences by Rt2dMaestro.
It may also be used by calling code to notify the Maestro of external events. This is carried out through the use of the Rt2dMaestroPostMessages and Rt2dMaestroProcessMessages functions.
Additionally, if a custom message handler is hooked to Rt2dMaestro, Rt2dMessage structures are passed to that handler. These may be examined to determine when particular animation events have occurred.
Rt2dMessage contains several pieces of information. Rt2dMessageType messageType
rt2dMESSAGETYPEPLAY Play animation rt2dMESSAGETYPESTOP Stop animation rt2dMESSAGETYPENEXTFRAME Advance to next frame rt2dMESSAGETYPEPREVFRAME Rewind to previouse frame rt2dMESSAGETYPEGOTOFRAME Advance to frame by index rt2dMESSAGETYPEGOTOLABEL Advance to frame by label rt2dMESSAGETYPEGETURL Get URL rt2dMESSAGETYPEFOREIGN Application specific message rt2dMESSAGETYPEMOUSEMOVETO Move mouse rt2dMESSAGETYPEMOUSEBUTTONSTATE Mouse button up or down rt2dMESSAGETYPEBUTTONBYLABEL Mouse button transition by label
This message type identifies how the other parameters are to be interpreted.
index is generally used to identify which animation within Rt2dMaestro that the message applies to. Messages posted externally may be sent to specific animations.
A description of the individual message types follows:
rt2dMESSAGETYPEPLAY Starts an animation playing. index is the animation that will start playing. intParam1, intParam2 are unused
rt2dMESSAGETYPESTOP Stops an animation. index is the animation that will stop playing. intParam1, intParam2 are unused
rt2dMESSAGETYPENEXTFRAME Advances an animation to the next frame. index is the animation that will be advanced. intParam1, intParam2 are unused
rt2dMESSAGETYPEPREVFRAME Rewinds an animation to the previous frame. index is the animation that will be rewound. intParam1, intParam2 are unused
rt2dMESSAGETYPEGOTOFRAME Goto to frame by index. index is the animation that will go to the specified frame. intParam1 is the frame number to go to, starting at frame 0. intParam2 is unused
rt2dMESSAGETYPEGOTOLABEL Advance to frame by label. index is the animation that will go to the specified frame. intParam1 is the index of the string label that contains the frame label of the frame to go to. intParam2 is unused
rt2dMESSAGETYPEGETURL Can be used as an extension mechanism. During content generation, a GetURL action may be specified with a string, eg GetURL("StartGame"). By hooking a custom message handler, the GetURL message may be intercepted and user to trigger in-game events. Nothing is done with this message by the default handler. index is the animation that the message was issued within. intParam1 is the index of the string label that was specified in the GetURL action. intParam2 is unused
rt2dMESSAGETYPEDOACTION Queues an internal list of messages. Not intended for external use. index is the animation that the message was issued within. intParam1 is the index of the message list to be queued. intParam2 is unused
rt2dMESSAGETYPEFOREIGN An extension mechanism for the inclusion of binary data. Reserved for future use. index is the animation that the message was issued within. intParam1 is the index of the binary data within an internal binary data store. intParam2 is unused
rt2dMESSAGETYPEMOUSEMOVETO Notification that the mouse has changed position. Causes update of button states. index is unused. intParam1 is the new mouse X coordinate. intParam2 is the new mouse Y coordinate
rt2dMESSAGETYPEMOUSEBUTTONSTATE Notification that the mouse button state has changed. index is unused. intParam1 is the button state; 0=up; 1=down. intParam2 is unused
rt2dMESSAGETYPESPECIALTELLTARGET Used internally to control which animation stored messages are applied to. Not for external use.
rt2dMESSAGETYPEBUTTONBYLABEL Cause a button transition on a button identified by a string label. May be used to pipe in external button presses to specific buttons identified by a name registered in a string labels. Buttons may be named in third party tools through an 'Export' option in those tools. index is the animation to send the button push to. intParam1 is the index of the string label naming the button. intParam2 is the button transition to be triggered, allowable transitions are rt2dANIMBUTTONSTATEIDLETOOVERUP rt2dANIMBUTTONSTATEOVERUPTOIDLE rt2dANIMBUTTONSTATEOVERUPTOOVERDOWN rt2dANIMBUTTONSTATEOVERDOWNTOOVERUP rt2dANIMBUTTONSTATEOVERDOWNTOOUTDOWN rt2dANIMBUTTONSTATEOUTDOWNTOOVERDOWN rt2dANIMBUTTONSTATEOUTDOWNTOIDLE rt2dANIMBUTTONSTATEIDLETOOVERDOWN rt2dANIMBUTTONSTATEOVERDOWNTOIDLE
|
Rt2dMessageHandlerCallBack represents the function called from Rt2dMaestroProcessMessages for all messages in the maestro's process message queue. The maestro does not filter any messages. The handler may process or ignore any messages it is given. This function should return the current message to indicate success. The callback may return NULL to terminate further callbacks on the maestro.
|
|
Rt2dMessageType, this type represents the different types of messages that are available.
|
|
Rt2dMaestroAddMessageList is used to add a list of messages to the maestro. The maestro maintains a central storage repository for all the internal messages used in an animation. The messages are copied into the repository and an index for retrieving the messages is returned.
|
|
Rt2dMaestroGetMessageHandler is used to retrieve the current message handler in the maestro. There is one handler for all messages.
|
|
Rt2dMaestroPostMessages is used to add a list of messages to the maestro's message queue. The maestro maintains a list of messages that are to be processed in the next Rt2dMaestroProcessMessages. This message queue can be filled internally, by other messages, or externally by the user. Messages in the queue are processed in sequence they are added. It is possible for the list to grow during message processing. Messages can add new messages for further processing. These new messages will be added to the end of the queue and processed in turn rather than immediately.
|
|
Rt2dMaestroProcessMessages is used to begin processing of the messages in the maestro's message queue. Once started, message processing will continue until all messages in the queue are processed. The message queue can grow during processing because messages can add additional messages to the queue.
|
|
Rt2dMaestroSetMessageHandler is used change the current message handler to the given one. There is only one message handler for all messages.
|
|
Rt2dMessageGetIndex is used retrieve the animation index which the message is to be applied to. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
Rt2dMessageGetMessageType is used to get the message's type, (Rt2dMessageType). Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
Rt2dMessageGetParam is used to retrieve the message specific parameters. Each message may have none, one or two additional parameters. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
Rt2dMessageHandlerDefaultCallBack is the default message handler. It supports most message types. Messages that are foreign or require external data are ignored. All messages in the message queue are passed to a single message handler. It is the handlers responsibility to either process or ignore messages. The maestro does not filter any messages. The handler may post new messages to maestro but it must not call Rt2dMaestroProcessMessages.
|
|
Rt2dMessageSetIndex is used to set the animation the message is applied to. A -1 indicates it is to be applied to the current animation. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
Rt2dMessageSetMessageType is used to set the type of the message, (Rt2dMessageType). Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
|
Rt2dMessageSetParam is used to set the message specific parameters. Each message may have none, one or two additional parameters. Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |