Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.GameViewportClient

Extends
Object
Modifiers
within Engine transient native DependsOn ( Interaction ) Inherits ( FViewportClient ) Inherits ( FExec )

A game viewport (FViewport) is a high-level abstract interface for the platform specific rendering, audio, and input subsystems. GameViewportClient is the engine's interface to a game viewport. Exactly one GameViewportClient is created for each instance of the game. The only case (so far) where you might have a single instance of Engine, but multiple instances of the game (and thus multiple GameViewportClients) is when you have more than PIE window running. Responsibilities: propagating input events to the global interactions list Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.

Core.Object
|   
+-- Engine.GameViewportClient

Direct Known Subclasses:

UTGameViewportClient

Constants Summary
Inherited Contants from Core.Object
DegToRad, INDEX_NONE, MaxInt, Pi, RadToDeg

Variables Summary
boolbDisableWorldRendering
boolbDisplayingUIMouseCursor
boolbShowTitleSafeZone
boolbUIMouseCaptureOverride
stringConnectingMessage
array<DebugDisplayProperty>DebugProperties
ESplitScreenTypeDefault2PSplitType
ESplitScreenTypeDefault3PSplitType
array<Interaction>GlobalInteractions
stringLoadingMessage
stringPausedMessage
stringPrecachingMessage
stringSavingMessage
qwordShowFlags
array<SplitscreenData>SplitscreenInfo
ESplitScreenTypeSplitscreenType
TitleSafeZoneAreaTitleSafeZone
UIInteractionUIController
class<UIInteraction>UIControllerClass
pointerViewport
ConsoleViewportConsole
pointerViewportFrame
Inherited Variables from Core.Object
Class, HashNext, HashOuterNext, Linker, LinkerIndex, Name, NetIndex, ObjectArchetype, ObjectFlags, ObjectInternalInteger, Outer, StateFrame, VfTableObject

Enumerations Summary
ESafeZoneType
eSZ_TOP, eSZ_BOTTOM, eSZ_LEFT, eSZ_RIGHT,
ESplitScreenType
eSST_NONE, eSST_2P_HORIZONTAL, eSST_2P_VERTICAL, eSST_3P_FAVOR_TOP, eSST_3P_FAVOR_BOTTOM, eSST_4P, eSST_COUNT, eSST_NOVALUE,
Inherited Enumerations from Core.Object
EAxis, EInputEvent, EInterpCurveMode, EInterpMethodType, ETickingGroup

Structures Summary
DebugDisplayProperty
Obj, PropertyName
PerPlayerSplitscreenData
SizeX, SizeY, OriginX, OriginY
SplitscreenData
PlayerData
TitleSafeZoneArea
MaxPercentX, MaxPercentY, RecommendedPercentX, RecommendedPercentY
Inherited Structures from Core.Object
Box, BoxSphereBounds, Color, Cylinder, double, DynamicMap_Mirror, Guid, IndirectArray_Mirror, InterpCurveFloat, InterpCurvePointFloat, InterpCurvePointQuat, InterpCurvePointTwoVectors, InterpCurvePointVector, InterpCurvePointVector2D, InterpCurveQuat, InterpCurveTwoVectors, InterpCurveVector, InterpCurveVector2D, IntPoint, LinearColor, Map_Mirror, Matrix, MultiMap_Mirror, Plane, pointer, Quat, qword, RawDistribution, RenderCommandFence, Rotator, TextureMipBulkData_Mirror, ThreadSafeCounter, TPOV, TwoVectors, UntypedBulkData_Mirror, Vector, Vector2D, Vector4

Delegates Summary
delegatebool HandleInputAxis (int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad)
delegatebool HandleInputChar (int ControllerId, string Unicode)
delegatebool HandleInputKey (int ControllerId, name Key, EInputEvent EventType, float AmountDepressed, optional bool bGamepad)

Functions Summary
function AddLocalPlayer (LocalPlayer NewPlayer ))
functionfloat CalculateDeadZone (LocalPlayer LPlayer, ESafeZoneType SZType, canvas Canvas, optional bool bUseMaxPercent ))
function CalculatePixelCenter (out float out_CenterX, out float out_CenterY, LocalPlayer LPlayer, canvas Canvas, optional bool bUseMaxPercent ))
function CalculateSafeZoneValues (out float out_Horizontal, out float out_Vertical, canvas Canvas, int LocalPlayerIndex, bool bUseMaxPercent ))
functionstring ConsoleCommand (string Command)
functionint ConvertLocalPlayerToGamePlayerIndex (LocalPlayer LPlayer ))
eventLocalPlayer CreatePlayer (int ControllerId, out string OutError, bool bSpawnActor))
function DebugCreatePlayer (int ControllerId))
function DebugRemovePlayer (int ControllerId))
function DrawTitleSafeArea (canvas Canvas ))
function DrawTransition (Canvas Canvas))
function DrawTransitionMessage (Canvas Canvas, tring Message))
eventLocalPlayer FindPlayerByControllerId (int ControllerId))
event GameSessionEnded ()))
function GetPixelSizeOfScreen (out float out_Width, out float out_Height, canvas Canvas, int LocalPlayerIndex ))
event GetSubtitleRegion (out vector2D MinPos, out vector2D MaxPos))
function GetViewportSize (out Vector2D out_ViewportSize)
functionbool HasBottomSafeZone (int LocalPlayerIndex ))
functionbool HasLeftSafeZone (int LocalPlayerIndex ))
functionbool HasRightSafeZone (int LocalPlayerIndex ))
functionbool HasTopSafeZone (int LocalPlayerIndex ))
eventbool Init (out string OutError))
eventint InsertInteraction (Interaction NewInteraction, optional int InIndex = -1 ))
functionbool IsFullScreenViewport ()
event LayoutPlayers ()))
function NotifyPlayerAdded (int PlayerIndex, LocalPlayer AddedPlayer ))
function NotifyPlayerRemoved (int PlayerIndex, LocalPlayer RemovedPlayer ))
event PostRender (Canvas Canvas))
function RemoveLocalPlayer (LocalPlayer ExistingPlayer ))
eventbool RemovePlayer (LocalPlayer ExPlayer))
function SetConsoleTarget (int PlayerIndex))
function SetSplit (int mode ))
function SetSplitscreenConfiguration (ESplitScreenType SplitType ))
function ShowTitleSafeArea ()))
function SSSwapControllers ()))
event Tick (float DeltaTime)
Inherited Functions from Core.Object
!, !=, $, $=, %, &, &&, *, **, *=, +, ++, +=, -, --, -=, / , /=, <, <<, <=, ==, >, >=, >>, >>>, @, @=, Abs, Acos, Asc, Asin, Atan, BeginState, ByteToFloat, Caps, Chr, Clamp, ClampLength, ClampRotAxis, ClassIsChildOf, ClearConfig, ClockwiseFrom, ColorToLinearColor, ContinuedState, Cos, Cross, Disable, Dot, DumpStateStack, DynamicLoadObject, Enable, EndState, Exp, FClamp, FCubicInterp, FindDeltaAngle, FindObject, FInterpEaseIn, FInterpEaseInOut, FInterpEaseOut, FInterpTo, FloatToByte, FMax, FMin, FPctByRange, FRand, GetAngularDegreesFromRadians, GetAngularDistance, GetAngularFromDotDist, GetAxes, GetDotDistance, GetEnum, GetFuncName, GetHeadingAngle, GetNetFuncName, GetPackageName, GetPerObjectConfigSections, GetRangePctByValue, GetRangeValueByPct, GetSpecialValue, GetStateName, GetUnAxes, GotoState, InStr, IsA, IsChildState, IsInState, IsNetScript, IsPendingKill, IsUTracing, IsZero, JoinArray, Left, Len, Lerp, Localize, Locs, Loge, LogInternal, MakeColor, MakeLinearColor, Max, Mid, Min, MirrorVectorByNormal, Normal, Normalize, NormalizeRotAxis, OrthoRotation, ParseStringIntoArray, PathName, PausedState, PointDistToLine, PointDistToPlane, PointInBox, PoppedState, PopState, ProjectOnTo, PushedState, PushState, QuatDot, QuatFindBetween, QuatFromAxisAndAngle, QuatFromRotator, QuatInvert, QuatProduct, QuatRotateVector, QuatSlerp, QuatToRotator, Rand, RandRange, RDiff, Repl, Right, RInterpTo, RLerp, RotRand, Round, RSize, RSmerp, SaveConfig, SClampRotAxis, ScriptTrace, SetSpecialValue, SetUTracing, Sin, Split, Sqrt, Square, StaticClearConfig, StaticSaveConfig, Tan, TimeStamp, ToHex, TransformVectorByRotation, UnwindHeading, vect2d, VInterpTo, VLerp, VRand, VSize, VSize2D, VSizeSq, VSizeSq2D, VSmerp, WarnInternal, ^, ^^, |, ||, ~, ~=


Variables Detail

bDisableWorldRendering Source code

var bool bDisableWorldRendering;
set to disable world rendering

bDisplayingUIMouseCursor Source code

var transient bool bDisplayingUIMouseCursor;
Indicates whether the UI is currently displaying a mouse cursor. Prevents GameEngine::Tick() from recapturing mouse input while the UI has active scenes that mouse input.

bShowTitleSafeZone Source code

var bool bShowTitleSafeZone;
if TRUE then the title safe border is drawn

bUIMouseCaptureOverride Source code

var transient bool bUIMouseCaptureOverride;
Indicates that the UI needs to receive all mouse input events. Usually enabled when the user is interacting with a draggable widget, such as a scrollbar or slider.

ConnectingMessage Source code

var localized string ConnectingMessage;

DebugProperties Source code

var array<DebugDisplayProperty> DebugProperties;

Default2PSplitType Source code

var const ESplitScreenType Default2PSplitType;
Defaults for intances where there are multiple configs for a certain number of players

Default3PSplitType Source code

var const ESplitScreenType Default3PSplitType;

GlobalInteractions Source code

var init array<Interaction> GlobalInteractions;
A list of interactions which have a chance at all input before the player's interactions.

LoadingMessage Source code

var localized string LoadingMessage;
@name Localized transition messages.

PausedMessage Source code

var localized string PausedMessage;

PrecachingMessage Source code

var localized string PrecachingMessage;

SavingMessage Source code

var localized string SavingMessage;

ShowFlags Source code

var const qword ShowFlags;
The show flags used by the viewport's players.

SplitscreenInfo Source code

var array<SplitscreenData> SplitscreenInfo;
Array of the screen data needed for all the different splitscreen configurations

SplitscreenType Source code

var ESplitScreenType SplitscreenType;
Current splitscreen type being used

TitleSafeZone Source code

var TitleSafeZoneArea TitleSafeZone;
border of safe area

UIController Source code

var UIInteraction UIController;
The viewport's UI controller

UIControllerClass Source code

var class<UIInteraction> UIControllerClass;
The class for the UI controller

Viewport Source code

var const pointer Viewport;
The platform-specific viewport which this viewport client is attached to.

ViewportConsole Source code

var Console ViewportConsole;
The viewport's console. Might be null on consoles

ViewportFrame Source code

var const pointer ViewportFrame;
The platform-specific viewport frame which this viewport is contained by.


Enumerations Detail

ESafeZoneType Source code

enum ESafeZoneType
{
eSZ_TOP, eSZ_BOTTOM, eSZ_LEFT, eSZ_RIGHT,
};
The 4 different kinds of safezones

ESplitScreenType Source code

enum ESplitScreenType
{
eSST_NONE, eSST_2P_HORIZONTAL, eSST_2P_VERTICAL, eSST_3P_FAVOR_TOP, eSST_3P_FAVOR_BOTTOM, eSST_4P, eSST_COUNT, eSST_NOVALUE,
};
Enum of the different splitscreen types


Structures Detail

DebugDisplayProperty Source code

struct DebugDisplayProperty
{
var Object Obj;
var name PropertyName;
};
debug property display functionality to interact with this, use "display", "displayall", "displayclear"
Obj:
the object whose property to display. If this is a class, all objects of that class are drawn.
PropertyName:
name of the property to display

PerPlayerSplitscreenData Source code

struct PerPlayerSplitscreenData
{
var float OriginX;
var float OriginY;
var float SizeX;
var float SizeY;
};
Structure to store splitscreen data.

SplitscreenData Source code

struct SplitscreenData
{
var array<PerPlayerSplitscreenData> PlayerData;
};
Structure containing all the player splitscreen datas per splitscreen configuration.

TitleSafeZoneArea Source code

struct TitleSafeZoneArea
{
var float MaxPercentX;
var float MaxPercentY;
var float RecommendedPercentX;
var float RecommendedPercentY;
};
Max/Recommended screen viewable extents as a percentage


Delegates Detail

HandleInputAxis Source code

delegate bool HandleInputAxis ( int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad )
Provides script-only child classes the opportunity to handle input axis events received from the viewport. This delegate is called before the input axis event is passed to the interactions array for processing.
@param ControllerId the controller that generated this input axis event
@param Key the name of the axis that moved (KEY_MouseX, KEY_XboxTypeS_LeftX, etc.)
@param Delta the movement delta for the axis
@param DeltaTime the time (in seconds) since the last axis update.
@param bGamepad input came from gamepad (ie xbox controller)
@return return TRUE to indicate that the input event was handled. if the return value is TRUE, this input event will not be passed to the interactions array.

HandleInputChar Source code

delegate bool HandleInputChar ( int ControllerId, string Unicode )
Provides script-only child classes the opportunity to handle character input (typing) events received from the viewport. This delegate is called before the character event is passed to the interactions array for processing.
@param ControllerId the controller that generated this character input event
@param Unicode the character that was typed
@return return TRUE to indicate that the input event was handled. if the return value is TRUE, this input event will not be passed to the interactions array.

HandleInputKey Source code

delegate bool HandleInputKey ( int ControllerId, name Key, EInputEvent EventType, float AmountDepressed, optional bool bGamepad )
Provides script-only child classes the opportunity to handle input key events received from the viewport. This delegate is called before the input key event is passed to the interactions array for processing.
@param ControllerId the controller that generated this input key event
@param Key the name of the key which an event occured for (KEY_Up, KEY_Down, etc.)
@param EventType the type of event which occured (pressed, released, etc.)
@param AmountDepressed for analog keys, the depression percent.
@param bGamepad input came from gamepad (ie xbox controller)
@return return TRUE to indicate that the input event was handled. if the return value is TRUE, this input event will not be passed to the interactions array.


Functions Detail

AddLocalPlayer Source code

private final function AddLocalPlayer ( LocalPlayer NewPlayer ) )
Adds a LocalPlayer to the local and global list of Players.
@param NewPlayer the player to add

CalculateDeadZone Source code

final function float CalculateDeadZone ( LocalPlayer LPlayer, ESafeZoneType SZType, canvas Canvas, optional bool bUseMaxPercent ) )

CalculatePixelCenter Source code

final function CalculatePixelCenter ( out float out_CenterX, out float out_CenterY, LocalPlayer LPlayer, canvas Canvas, optional bool bUseMaxPercent ) )
Calculate the pixel value of the center of the viewport - this takes the safezones into consideration.

CalculateSafeZoneValues Source code

final function CalculateSafeZoneValues ( out float out_Horizontal, out float out_Vertical, canvas Canvas, int LocalPlayerIndex, bool bUseMaxPercent ) )
Calculate the amount of safezone needed for a single side for both vertical and horizontal dimensions

ConsoleCommand Source code

native function string ConsoleCommand ( string Command )
Executes a console command in the context of this viewport.
@param Command - The command to execute.
@return The output of the command will be returned.

ConvertLocalPlayerToGamePlayerIndex Source code

final function int ConvertLocalPlayerToGamePlayerIndex ( LocalPlayer LPlayer ) )
Convert a LocalPlayer to it's index in the GamePlayer array Returns -1 if the index could not be found.

CreatePlayer Source code

event LocalPlayer CreatePlayer ( int ControllerId, out string OutError, bool bSpawnActor) )
Adds a new player.
@param ControllerId - The controller ID the player should accept input from.
@param OutError - If no player is returned, OutError will contain a string describing the reason.
@param SpawnActor - True if an actor should be spawned for the new player.
@return The player which was created.

DebugCreatePlayer Source code

exec function DebugCreatePlayer ( int ControllerId) )
Debug console command to create a player.
@param ControllerId - The controller ID the player should accept input from.

DebugRemovePlayer Source code

exec function DebugRemovePlayer ( int ControllerId) )
Debug console command to remove the player with a given controller ID.
@param ControllerId - The controller ID to search for.

DrawTitleSafeArea Source code

function DrawTitleSafeArea ( canvas Canvas ) )
Draw the safe area using the current TitleSafeZone settings

DrawTransition Source code

function DrawTransition ( Canvas Canvas) )
Displays the transition screen.
@param Canvas - The canvas to use for rendering.

DrawTransitionMessage Source code

function DrawTransitionMessage ( Canvas Canvas,string Message) )
Print a centered transition message with a drop shadow.

FindPlayerByControllerId Source code

final event LocalPlayer FindPlayerByControllerId ( int ControllerId) )
Finds a player by controller ID.
@param ControllerId - The controller ID to search for.
@return None or the player with matching controller ID.

GameSessionEnded Source code

event GameSessionEnded ( ) )
Called when the current map is being unloaded. Cleans up any references which would prevent garbage collection.

GetPixelSizeOfScreen Source code

final function GetPixelSizeOfScreen ( out float out_Width, out float out_Height, canvas Canvas, int LocalPlayerIndex ) )
Get the total pixel size of the screen. This is different from the pixel size of the viewport since we could be in splitscreen

GetSubtitleRegion Source code

event GetSubtitleRegion ( out vector2D MinPos, out vector2D MaxPos) )
called before rending subtitles to allow the game viewport to determine the size of the subtitle area
@param Min top left bounds of subtitle region (0 to 1)
@param Max bottom right bounds of subtitle region (0 to 1)

GetViewportSize Source code

native final function GetViewportSize ( out Vector2D out_ViewportSize )
Retrieve the size of the main viewport.
@param out_ViewportSize [out] will be filled in with the size of the main viewport

HasBottomSafeZone Source code

final function bool HasBottomSafeZone ( int LocalPlayerIndex ) )
Whether the player at LocalPlayerIndex's viewport has a "bottom of viewport" safezone or not.

HasLeftSafeZone Source code

final function bool HasLeftSafeZone ( int LocalPlayerIndex ) )
Whether the player at LocalPlayerIndex's viewport has a "left of viewport" safezone or not.

HasRightSafeZone Source code

final function bool HasRightSafeZone ( int LocalPlayerIndex ) )
Whether the player at LocalPlayerIndex's viewport has a "right of viewport" safezone or not.

HasTopSafeZone Source code

final function bool HasTopSafeZone ( int LocalPlayerIndex ) )
Whether the player at LocalPlayerIndex's viewport has a "top of viewport" safezone or not.

Init Source code

event bool Init ( out string OutError) )
Initialize the game viewport.
@param OutError - If an error occurs, returns the error description.
@return False if an error occurred, true if the viewport was initialized successfully.

InsertInteraction Source code

event int InsertInteraction ( Interaction NewInteraction, optional int InIndex = -1 ) )
Inserts an interaction into the GlobalInteractions array at the specified index
@param NewInteraction the interaction that should be inserted into the array
@param Index the position in the GlobalInteractions array to insert the element. if no value (or -1) is specified, inserts the interaction at the end of the array
@return the position in the GlobalInteractions array where the element was placed, or -1 if the element wasn't added to the array for some reason

IsFullScreenViewport Source code

native final function bool IsFullScreenViewport ( )

@return Whether or not the main viewport is fullscreen or windowed.

LayoutPlayers Source code

event LayoutPlayers ( ) )
Called before rendering to allow the game viewport to allocate subregions to players.

NotifyPlayerAdded Source code

final function NotifyPlayerAdded ( int PlayerIndex, LocalPlayer AddedPlayer ) )
Notifies all interactions that a new player has been added to the list of active players.
@param PlayerIndex the index [into the GamePlayers array] where the player was inserted
@param AddedPlayer the player that was added

NotifyPlayerRemoved Source code

final function NotifyPlayerRemoved ( int PlayerIndex, LocalPlayer RemovedPlayer ) )
Notifies all interactions that a new player has been added to the list of active players.
@param PlayerIndex the index [into the GamePlayers array] where the player was located
@param RemovedPlayer the player that was removed

PostRender Source code

event PostRender ( Canvas Canvas) )
Called after rendering the player views and HUDs to render menus, the console, etc. This is the last rendering call in the render loop
@param Canvas - The canvas to use for rendering.

RemoveLocalPlayer Source code

private final function RemoveLocalPlayer ( LocalPlayer ExistingPlayer ) )
Removes a LocalPlayer from the local and global list of Players.
@param ExistingPlayer the player to remove

RemovePlayer Source code

event bool RemovePlayer ( LocalPlayer ExPlayer) )
Removes a player.
@param Player - The player to remove.
@return whether the player was successfully removed. Removal is not allowed while connected to a server.

SetConsoleTarget Source code

exec function SetConsoleTarget ( int PlayerIndex) )
Sets the player which console commands will be executed in the context of.

SetSplit Source code

exec function SetSplit ( int mode ) )
debug test for testing splitscreens

SetSplitscreenConfiguration Source code

function SetSplitscreenConfiguration ( ESplitScreenType SplitType ) )
Sets up the splitscreen configuration and does some sanity checking

ShowTitleSafeArea Source code

exec function ShowTitleSafeArea ( ) )
Exec for toggling the display of the title safe area

SSSwapControllers Source code

exec function SSSwapControllers ( ) )
Rotates controller ids among gameplayers, useful for testing splitscreen with only one controller.

Tick Source code

event Tick ( float DeltaTime )
Called every frame to allow the game viewport to update time based state.
@param DeltaTime - The time since the last call to Tick.


Defaultproperties

defaultproperties
{
   UIControllerClass=Class'Engine.UIInteraction'
   ShowFlags=
   LoadingMessage="LOADING"
   SavingMessage="SAVING"
   ConnectingMessage="CONNECTING"
   PausedMessage="PAUSED"
   PrecachingMessage="PRECACHING"
   TitleSafeZone=(MaxPercentX=0.900000,MaxPercentY=0.900000,RecommendedPercentX=0.800000,RecommendedPercentY=0.800000)
   SplitscreenInfo(0)=(PlayerData=((SizeX=1.000000,SizeY=1.000000)))
   SplitscreenInfo(1)=(PlayerData=((SizeX=1.000000,SizeY=0.500000),(SizeX=1.000000,SizeY=0.500000,OriginY=0.500000)))
   SplitscreenInfo(2)=(PlayerData=((SizeX=0.500000,SizeY=1.000000),(SizeX=0.500000,SizeY=1.000000,OriginX=0.500000)))
   SplitscreenInfo(3)=(PlayerData=((SizeX=1.000000,SizeY=0.500000),(SizeX=0.500000,SizeY=0.500000,OriginY=0.500000),(SizeX=0.500000,SizeY=0.500000,OriginX=0.500000,OriginY=0.500000)))
   SplitscreenInfo(4)=(PlayerData=((SizeX=0.500000,SizeY=0.500000),(SizeX=0.500000,SizeY=0.500000,OriginX=0.500000),(SizeX=1.000000,SizeY=0.500000,OriginY=0.500000)))
   SplitscreenInfo(5)=(PlayerData=((SizeX=0.500000,SizeY=0.500000),(SizeX=0.500000,SizeY=0.500000,OriginX=0.500000),(SizeX=0.500000,SizeY=0.500000,OriginY=0.500000),(SizeX=0.500000,SizeY=0.500000,OriginX=0.500000,OriginY=0.500000)))
   SplitscreenType=eSST_NOVALUE
   Default2PSplitType=eSST_2P_HORIZONTAL
   Default3PSplitType=eSST_3P_FAVOR_TOP
   Name="Default__GameViewportClient"
   ObjectArchetype=Object'Core.Default__Object'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Creation time: sk 18-3-2018 10:00:37.255 - Created with UnCodeX