unreal.GameViewportSubsystem
¶
- class unreal.GameViewportSubsystem(outer: Optional[Object] = None, name: Union[Name, str] = 'None')¶
Bases:
GameInstanceSubsystem
Game Viewport Subsystem
C++ Source:
Module: UMG
File: GameViewportSubsystem.h
- add_widget(widget, slot) None ¶
Adds it to the game’s viewport.
- Parameters:
widget (Widget) –
slot (GameViewportWidgetSlot) –
- add_widget_for_player(widget, player, slot) None ¶
Adds the widget to the game’s viewport in the section dedicated to the player. This is valuable in a split screen game where you need to only show a widget over a player’s portion of the viewport.
- Parameters:
widget (Widget) –
player (LocalPlayer) –
slot (GameViewportWidgetSlot) –
- get_widget_slot(widget) GameViewportWidgetSlot ¶
The slot info from previously added widget or info that is store for later.
- Parameters:
widget (Widget) –
- Return type:
- set_widget_slot(widget, slot) None ¶
Update the slot info of a previously added widget or Store the slot info for later use.
- Parameters:
widget (Widget) –
slot (GameViewportWidgetSlot) –
- classmethod set_widget_slot_desired_size(slot, size) GameViewportWidgetSlot ¶
Helper function to set the desired size in the viewport for the Slot.
- Parameters:
slot (GameViewportWidgetSlot) –
size (Vector2D) –
- Return type:
- classmethod set_widget_slot_position(slot, widget, position, remove_dpi_scale) GameViewportWidgetSlot ¶
Helper function to set the position in the viewport for the Slot.
- Parameters:
slot (GameViewportWidgetSlot) –
widget (Widget) –
position (Vector2D) – The 2D position to set the widget to in the viewport.
remove_dpi_scale (bool) – If you’ve already calculated inverse DPI, set this to false. Otherwise inverse DPI is applied to the position so that when the location is scaled by DPI, it ends up in the expected position.
- Return type: