| Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
| previous class next class | frames no frames | |||||
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-2007 Epic Games, Inc. All Rights Reserved.
Core.Object | +-- Engine.GameViewportClient
UTGameViewportClient
| Constants Summary |
|---|
| Inherited Contants from Core.Object |
|---|
| DegToRad, INDEX_NONE, MaxInt, Pi, RadToDeg |
| 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 | ||
|---|---|---|
| PerPlayerSplitscreenData SizeX, SizeY, OriginX, OriginY | ||
| SplitscreenData PlayerData | ||
| TitleSafeZoneArea MaxPercentX, MaxPercentY, RecommendedPercentX, RecommendedPercentY | ||
| Delegates Summary | ||
|---|---|---|
![]() | bool | HandleInputAxis (int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad) |
![]() | bool | HandleInputChar (int ControllerId, string Unicode) |
![]() | bool | HandleInputKey (int ControllerId, name Key, EInputEvent EventType, float AmountDepressed, optional bool bGamepad) |
| Functions Summary | ||
|---|---|---|
![]() | AddLocalPlayer (LocalPlayer NewPlayer )) | |
![]() | float | CalculateDeadZone (LocalPlayer LPlayer, ESafeZoneType SZType, canvas Canvas, optional bool bUseMaxPercent )) |
![]() | CalculatePixelCenter (out float out_CenterX, out float out_CenterY, LocalPlayer LPlayer, canvas Canvas, optional bool bUseMaxPercent )) | |
![]() | CalculateSafeZoneValues (out float out_Horizontal, out float out_Vertical, canvas Canvas, int LocalPlayerIndex, bool bUseMaxPercent )) | |
![]() | string | ConsoleCommand (string Command) |
![]() | int | ConvertLocalPlayerToGamePlayerIndex (LocalPlayer LPlayer )) |
![]() | LocalPlayer | CreatePlayer (int ControllerId, out string OutError, bool bSpawnActor)) |
![]() | DebugCreatePlayer (int ControllerId)) | |
![]() | DebugRemovePlayer (int ControllerId)) | |
![]() | DrawTitleSafeArea (canvas Canvas )) | |
![]() | DrawTransition (Canvas Canvas)) | |
![]() | DrawTransitionMessage (Canvas Canvas, tring Message)) | |
![]() | LocalPlayer | FindPlayerByControllerId (int ControllerId)) |
![]() | GameSessionEnded ())) | |
![]() | GetPixelSizeOfScreen (out float out_Width, out float out_Height, canvas Canvas, int LocalPlayerIndex )) | |
![]() | GetSubtitleRegion (out vector2D MinPos, out vector2D MaxPos)) | |
![]() | GetViewportSize (out Vector2D out_ViewportSize) | |
![]() | bool | HasBottomSafeZone (int LocalPlayerIndex )) |
![]() | bool | HasLeftSafeZone (int LocalPlayerIndex )) |
![]() | bool | HasRightSafeZone (int LocalPlayerIndex )) |
![]() | bool | HasTopSafeZone (int LocalPlayerIndex )) |
![]() | bool | Init (out string OutError)) |
![]() | int | InsertInteraction (Interaction NewInteraction, optional int InIndex = -1 )) |
![]() | bool | IsFullScreenViewport () |
![]() | LayoutPlayers ())) | |
![]() | NotifyPlayerAdded (int PlayerIndex, LocalPlayer AddedPlayer )) | |
![]() | NotifyPlayerRemoved (int PlayerIndex, LocalPlayer RemovedPlayer )) | |
![]() | PostRender (Canvas Canvas)) | |
![]() | RemoveLocalPlayer (LocalPlayer ExistingPlayer )) | |
![]() | bool | RemovePlayer (LocalPlayer ExPlayer)) |
![]() | SetConsoleTarget (int PlayerIndex)) | |
![]() | SetSplit (int mode )) | |
![]() | SetSplitscreenConfiguration (ESplitScreenType SplitType )) | |
![]() | ShowTitleSafeArea ())) | |
![]() | SSSwapControllers ())) | |
![]() | Tick (float DeltaTime) | |
| Variables Detail |
|---|
set to disable world rendering
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.
if TRUE then the title safe border is drawn
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.
Defaults for intances where there are multiple configs for a certain number of players
A list of interactions which have a chance at all input before the player's interactions.
@name Localized transition messages.
The show flags used by the viewport's players.
Array of the screen data needed for all the different splitscreen configurations
Current splitscreen type being used
border of safe area
The viewport's UI controller
The class for the UI controller
The platform-specific viewport which this viewport client is attached to.
The viewport's console. Might be null on consoles
The platform-specific viewport frame which this viewport is contained by.
| Enumerations Detail |
|---|
The 4 different kinds of safezones
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 |
|---|
var float OriginX;};
var float OriginY;
var float SizeX;
var float SizeY;
Structure to store splitscreen data.
Structure containing all the player splitscreen datas per splitscreen configuration.
var float MaxPercentX;};
var float MaxPercentY;
var float RecommendedPercentX;
var float RecommendedPercentY;
Max/Recommended screen viewable extents as a percentage
| Delegates Detail |
|---|
HandleInputAxis Source codeProvides 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 codeProvides 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 codeProvides 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 codeAdds a LocalPlayer to the local and global list of Players.
@param NewPlayer the player to add
CalculateDeadZone Source code
CalculatePixelCenter Source codeCalculate the pixel value of the center of the viewport - this takes the safezones into consideration.
CalculateSafeZoneValues Source codeCalculate the amount of safezone needed for a single side for both vertical and horizontal dimensions
ConsoleCommand Source codeExecutes 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 codeConvert a LocalPlayer to it's index in the GamePlayer array Returns -1 if the index could not be found.
CreatePlayer Source codeAdds 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 codeDebug console command to create a player.
@param ControllerId - The controller ID the player should accept input from.
DebugRemovePlayer Source codeDebug console command to remove the player with a given controller ID.
@param ControllerId - The controller ID to search for.
DrawTitleSafeArea Source codeDraw the safe area using the current TitleSafeZone settings
DrawTransition Source codeDisplays the transition screen.
@param Canvas - The canvas to use for rendering.
DrawTransitionMessage Source codePrint a centered transition message with a drop shadow.
FindPlayerByControllerId Source codeFinds a player by controller ID.
@param ControllerId - The controller ID to search for.
@return None or the player with matching controller ID.
GameSessionEnded Source codeCalled when the current map is being unloaded. Cleans up any references which would prevent garbage collection.
GetPixelSizeOfScreen Source codeGet 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 codecalled 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 codeRetrieve the size of the main viewport.
@param out_ViewportSize [out] will be filled in with the size of the main viewport
HasBottomSafeZone Source codeWhether the player at LocalPlayerIndex's viewport has a "bottom of viewport" safezone or not.
HasLeftSafeZone Source codeWhether the player at LocalPlayerIndex's viewport has a "left of viewport" safezone or not.
HasRightSafeZone Source codeWhether the player at LocalPlayerIndex's viewport has a "right of viewport" safezone or not.
HasTopSafeZone Source codeWhether the player at LocalPlayerIndex's viewport has a "top of viewport" safezone or not.
Init Source codeInitialize 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 codeInserts 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
@return Whether or not the main viewport is fullscreen or windowed.
LayoutPlayers Source codeCalled before rendering to allow the game viewport to allocate subregions to players.
NotifyPlayerAdded Source codeNotifies 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 codeNotifies 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 codeCalled 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 codeRemoves a LocalPlayer from the local and global list of Players.
@param ExistingPlayer the player to remove
RemovePlayer Source codeRemoves 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 codeSets the player which console commands will be executed in the context of.
SetSplit Source codedebug test for testing splitscreens
SetSplitscreenConfiguration Source codeSets up the splitscreen configuration and does some sanity checking
ShowTitleSafeArea Source codeExec for toggling the display of the title safe area
SSSwapControllers Source codeRotates controller ids among gameplayers, useful for testing splitscreen with only one controller.
Tick Source codeCalled 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 | UnrealScript Documentation |
| previous class next class | frames no frames | |||||