## Engine
Class Interaction

source: C:\XIII\Engine\Classes\Interaction.uc

    Core.Object
       |
       +--Engine.Interactions
          |
          +--Engine.Interaction

Direct Known Subclasses:BaseGUIController, Console, XIIIPlayerInteraction

class Interaction
extends Engine.Interactions

    // ====================================================================
    //  Class:  Engine.Interaction
    //
    //  Each individual Interaction is a jumping point in UScript.  The should
    //  be the foundatation for any subsystem that requires interaction with
    //  the player (such as a menu).
    //
    //  Interactions take on two forms, the Global Interaction and the Local
    //  Interaction.  The GI get's to process data before the LI and get's
    //  render time after the LI, so in essence the GI wraps the LI.
    //
    //  A dynamic array of GI's are stored in the InteractionMaster while
    //  each Viewport contains an array of LIs.
    //
    //
    // (c) 2001, Epic Games, Inc.  All Rights Reserved
    // ====================================================================

Variables
`InteractionMaster` | `Master` Pointer to the Interaction Master
`Player` | `ViewportOwner` Pointer to the ViewPort that "Owns" this interaction or none if it's Global
`bool` | `bActive` Is this interaction Getting Input
`bool` | `bNativeEvents` This interaction requests native events
`bool` | `bRequiresTick` Does this interaction require game TICK
`bool` | `bVisible` Is this interaction being Displayed

Function Summary
`bool` | `ConsoleCommand(string S)`
    // setup the state system and stack frame
`void` | `Initialize()`
    //-----------------------------------------------------------------------------
    // natives.
`vector` | `ScreenToWorld(vector Location, optional vector, optional rotator)`
    // ====================================================================
    // ScreenToWorld - Converts an X/Y screen coordinate in to a world vector
    // ====================================================================
`void` | `SetFocus()`
    // ====================================================================
    // SetFocus - This function cases the Interaction to gain "focus" in the interaction
    // system.  Global interactions's focus superceed locals.
    // ====================================================================
`vector` | `WorldToScreen(vector Location, optional vector, optional rotator)`
    // ====================================================================
    // WorldToScreen - Returns the X/Y screen coordinates in to a viewport of a given vector
    // in the world.
    // ====================================================================

Source Code

    00001	// ====================================================================
    00002	//  Class:  Engine.Interaction
    00003	//
    00004	//  Each individual Interaction is a jumping point in UScript.  The should
    00005	//  be the foundatation for any subsystem that requires interaction with
    00006	//  the player (such as a menu).
    00007	//
    00008	//  Interactions take on two forms, the Global Interaction and the Local
    00009	//  Interaction.  The GI get's to process data before the LI and get's
    00010	//  render time after the LI, so in essence the GI wraps the LI.
    00011	//
    00012	//  A dynamic array of GI's are stored in the InteractionMaster while
    00013	//  each Viewport contains an array of LIs.
    00014	//
    00015	//
    00016	// (c) 2001, Epic Games, Inc.  All Rights Reserved
    00017	// ====================================================================
    00018
    00019	class Interaction extends Interactions
    00020		native;
    00021
    00022	var bool bActive;			// Is this interaction Getting Input
    00023	var bool bVisible;			// Is this interaction being Displayed
    00024	var bool bRequiresTick; 	// Does this interaction require game TICK
    00025	var bool bNativeEvents;		// This interaction requests native events
    00026
    00027	// These entries get filled out upon creation.
    00028
    00029	var Player ViewportOwner;		// Pointer to the ViewPort that "Owns" this interaction or none if it's Global
    00030	var InteractionMaster Master;	// Pointer to the Interaction Master
    00031
    00032	//-----------------------------------------------------------------------------
    00033	// natives.
    00034
    00035	native function Initialize();							// setup the state system and stack frame
    00036	native function bool ConsoleCommand( coerce string S );	// Executes a console command
    00037
    00038	// WorldToScreen converts a vector in the world
    00039
    00040	// ====================================================================
    00041	// WorldToScreen - Returns the X/Y screen coordinates in to a viewport of a given vector
    00042	// in the world.
    00043	// ====================================================================
    00044	native function vector WorldToScreen(vector Location, optional vector CameraLocation, optional rotator CameraRotation);
    00045
    00046	// ====================================================================
    00047	// ScreenToWorld - Converts an X/Y screen coordinate in to a world vector
    00048	// ====================================================================
    00049	native function vector ScreenToWorld(vector Location, optional vector CameraLocation, optional rotator CameraRotation);
    00050
    00051	// ====================================================================
    00052	// Initialized - Called directly after an Interaction Object has been created
    00053	// and Initialized.  Should be subclassed
    00054	// ====================================================================
    00055
    00056	event Initialized();
    00057
    00058
    00059	// ====================================================================
    00060	// Message - This event allows interactions to receive messages
    00061	// ====================================================================
    00062
    00063	event Message( coerce string Msg, float MsgLife)
    00064	{
    00065	} // Message
    00066
    00067	// ====================================================================
    00068	// EndMap - Prevent before to change of map.
    00069	// ====================================================================
    00070	event EndMap()
    00071	{
    00072	}
    00073
    00074	// ====================================================================
    00075	// ====================================================================
    00076	// Input Routines - These two routines are the entry points for input.  They both
    00077	// return true if the data has been processed and should now discarded.
    00078
    00079	// Both functions should be handled in a subclass of Interaction
    00080	// ====================================================================
    00081	// ====================================================================
    00082
    00083	event bool KeyType( out EInputKey Key )
    00084	{
    00085		return false;
    00086	}
    00087
    00088	event bool KeyEvent( out EInputKey Key, out EInputAction Action, FLOAT Delta )
    00089	{
    00090		return false;
    00091	}
    00092
    00093	// ====================================================================
    00094	// ====================================================================
    00095	// Render Routines - All Interactions recieve both PreRender and PostRender
    00096	// calls.
    00097
    00098	// Both functions should be handled in a subclass of Interaction
    00099	// ====================================================================
    00100	// ====================================================================
    00101
    00102
    00103	event PreRender( canvas Canvas );
    00104	event PostRender( canvas Canvas );
    00105
    00106	// ====================================================================
    00107	// SetFocus - This function cases the Interaction to gain "focus" in the interaction
    00108	// system.  Global interactions's focus superceed locals.
    00109	// ====================================================================
    00110
    00111	function SetFocus()
    00112	{
    00113		Master.SetFocusTo(self,ViewportOwner);
    00114
    00115	} // SetFocus
    00116
    00117	// ====================================================================
    00118	// Tick - By default, Interactions do not get ticked, but you can
    00119	// simply turn on bRequiresTick.
    00120	// ====================================================================
    00121
    00122	event Tick(float DeltaTime);
    00123
    00124	defaultproperties
    00125	{
    00126	     bActive=True
    00127	}

End Source Code