FLocalPlayerManager
- Module
- Game
- Header
#include "Game/LocalPlayer.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr int32_t | kMaxLocalPlayers | Default 4. |
Public functions
| Returns | Name | Description |
|---|---|---|
FLocalPlayer& | AddLocalPlayer | Add a player driven by gamepadIndex (-1 = keyboard/mouse). |
bool | RemoveLocalPlayer | |
void | Clear | |
const std::vector<FLocalPlayer>& | GetLocalPlayers | |
int32_t | GetLocalPlayerCount | |
FLocalPlayer* | GetByPlayerIndex | |
const FLocalPlayer* | GetByPlayerIndex | |
FLocalPlayer* | GetByGamepad | |
int32_t | PlayerIndexForGamepad | Player index a gamepad slot routes to, or -1 when the slot owns no player (the input layer drops the event, or hands it to player 0's keyboard fallback, as the game prefers). |
void | BindController | Hands the player's controller its input instance (UE's ULocalPlayer::PlayerController); bindings, mapping contexts and pushed contexts then evaluate against that player's devices only. |
void | UpdateInputs | Advances every per-player input instance; the global one is advanced by the engine loop. |
void | SetLayout | |
ESplitScreenLayout | GetLayout | |
int32_t | RecomputeLayout | Retile the panes for the current player count and screen size, writing each player's rect. |
bool | RendersCamera | Whether a scene camera draws this frame. |
Function details
AddLocalPlayer
FLocalPlayer& AddLocalPlayer(int32_t gamepadIndex)Add a player driven by gamepadIndex (-1 = keyboard/mouse). Assigns the next free playerIndex and returns the new player. Refuses past kMaxLocalPlayers, and refuses a gamepad slot already owned by another player — returns the existing owner in that case.
RemoveLocalPlayer
bool RemoveLocalPlayer(int32_t playerIndex)Clear
void Clear()GetLocalPlayers
const std::vector<FLocalPlayer>& GetLocalPlayers() constGetLocalPlayerCount
int32_t GetLocalPlayerCount() constGetByPlayerIndex
FLocalPlayer* GetByPlayerIndex(int32_t playerIndex)GetByPlayerIndex
const FLocalPlayer* GetByPlayerIndex(int32_t playerIndex) constGetByGamepad
FLocalPlayer* GetByGamepad(int32_t gamepadIndex)PlayerIndexForGamepad
int32_t PlayerIndexForGamepad(int32_t gamepadIndex) constPlayer index a gamepad slot routes to, or -1 when the slot owns no player (the input layer drops the event, or hands it to player 0's keyboard fallback, as the game prefers).
BindController
void BindController(int32_t playerIndex, APlayerController* controller)Hands the player's controller its input instance (UE's ULocalPlayer::PlayerController); bindings, mapping contexts and pushed contexts then evaluate against that player's devices only.
UpdateInputs
void UpdateInputs(float deltaSeconds)Advances every per-player input instance; the global one is advanced by the engine loop. Once per frame, with engine time.
SetLayout
void SetLayout(ESplitScreenLayout layout)GetLayout
ESplitScreenLayout GetLayout() constRecomputeLayout
int32_t RecomputeLayout(uint32_t screenW, uint32_t screenH)Retile the panes for the current player count and screen size, writing each player's rect. Does NOT touch cameras — the caller copies player.rect onto its CameraComponent. Returns the pane count.
RendersCamera
bool RendersCamera(EntityID camera) constWhether a scene camera draws this frame. With one player every camera does; in split screen only the cameras the players look through do, since any other camera (the pawn's own, a stray one) still carries a full-screen viewport and painted over every pane.