unreal.UserWidget

class unreal.UserWidget(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Widget

The user widget is extensible by users through the WidgetBlueprint.

C++ Source:

  • Module: UMG

  • File: UserWidget.h

Editor Properties: (see get_editor_property/set_editor_property)

  • accessible_behavior (SlateAccessibleBehavior): [Read-Write] Accessible Behavior: Whether or not the widget is accessible, and how to describe it. If set to custom, additional customization options will appear.

  • accessible_summary_behavior (SlateAccessibleBehavior): [Read-Write] Accessible Summary Behavior: How to describe this widget when it’s being presented through a summary of a parent widget. If set to custom, additional customization options will appear.

  • accessible_summary_text (Text): [Read-Write] Accessible Summary Text: When AccessibleSummaryBehavior is set to Custom, this is the text that will be used to describe the widget.

  • accessible_text (Text): [Read-Write] Accessible Text: When AccessibleBehavior is set to Custom, this is the text that will be used to describe the widget.

  • can_children_be_accessible (bool): [Read-Write] Can Children be Accessible: Whether or not children of this widget can appear as distinct accessible widgets.

  • clipping (WidgetClipping): [Read-Write] Clipping

  • color_and_opacity (LinearColor): [Read-Write] Color and Opacity: The color and opacity of this widget. Tints all child widgets.

  • cursor (MouseCursor): [Read-Write] Cursor

  • flow_direction_preference (FlowDirectionPreference): [Read-Write] Flow Direction Preference

  • foreground_color (SlateColor): [Read-Write] Foreground Color: The foreground color of the widget, this is inherited by sub widgets. Any color property that is marked as inherit will use this color.

  • is_enabled (bool): [Read-Write] Is Enabled

  • is_focusable (bool): [Read-Write] Is Focusable: Setting this flag to true, allows this widget to accept focus when clicked, or when navigated to.

  • is_volatile (bool): [Read-Write] Is Volatile: If true prevents the widget or its child’s geometry or layout information from being cached. If this widget changes every frame, but you want it to still be in an invalidation panel you should make it as volatile instead of invalidating it every frame, which would prevent the invalidation panel from actually ever caching anything.

  • navigation (WidgetNavigation): [Read-Write] Navigation: The navigation object for this widget is optionally created if the user has configured custom navigation rules for this widget in the widget designer. Those rules determine how navigation transitions can occur between widgets.

  • on_visibility_changed (OnVisibilityChangedEvent): [Read-Write] On Visibility Changed: Called when the visibility has changed

  • override_accessible_defaults (bool): [Read-Write] Override Accessible Defaults: Override all of the default accessibility behavior and text for this widget.

  • override_cursor (bool): [Read-Write] Override Cursor

  • padding (Margin): [Read-Write] Padding: The padding area around the content.

  • preview_background (Texture2D): [Read-Write] Preview Background: A preview background that you can use when designing the UI to get a sense of scale on the screen. Use a texture with a screenshot of your game in it, for example if you were designing a HUD.

  • priority (int32): [Read-Write] Priority

  • render_opacity (float): [Read-Write] Render Opacity

  • render_transform (WidgetTransform): [Read-Write] Render Transform

  • render_transform_pivot (Vector2D): [Read-Write] Render Transform Pivot

  • slot (PanelSlot): [Read-Write] Slot: The parent slot of the UWidget. Allows us to easily inline edit the layout controlling this widget.

  • stop_action (bool): [Read-Write] Stop Action

  • tick_frequency (WidgetTickFrequency): [Read-Write] Tick Frequency: This widget is allowed to tick. If this is unchecked tick will never be called, animations will not play correctly, and latent actions will not execute. Uncheck this for performance reasons only

  • tool_tip_text (Text): [Read-Write] Tool Tip Text

  • tool_tip_widget (Widget): [Read-Only] Tool Tip Widget

  • visibility (SlateVisibility): [Read-Write] Visibility

add_extension(extension_type) UserWidgetExtension

Add the extension of the requested type.

Parameters:

extension_type (type(Class)) –

Return type:

UserWidgetExtension

add_to_player_screen(z_order=0) bool

Adds the widget to the game’s viewport in a 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:

z_order (int32) – The higher the number, the more on top this widget will be.

Return type:

bool

add_to_viewport(z_order=0) None

Adds it to the game’s viewport and fills the entire screen, unless SetDesiredSizeInViewport is called to explicitly set the size.

Parameters:

z_order (int32) – The higher the number, the more on top this widget will be.

bind_to_animation_event(animation, delegate, animation_event, user_tag='None') None

Allows binding to a specific animation’s event.

Parameters:
  • animation (WidgetAnimation) – the animation to listen for starting or finishing.

  • delegate (WidgetAnimationDynamicEvent) – the delegate to call when the animation’s state changes

  • animation_event (WidgetAnimationEvent) – the event to watch for.

  • user_tag (Name) – Scopes the delegate to only be called when the animation completes with a specific tag set on it when it was played.

bind_to_animation_finished(animation, delegate) None

Bind an animation finished delegate.

Parameters:
bind_to_animation_started(animation, delegate) None

Bind an animation started delegate.

Parameters:
cancel_latent_actions() None

Cancels any pending Delays or timer callbacks for this widget.

property color_and_opacity: LinearColor

[Read-Only] Color and Opacity: The color and opacity of this widget. Tints all child widgets.

Type:

(LinearColor)

construct() None

Called after the underlying slate widget is constructed. Depending on how the slate object is used this event may be called multiple times due to adding and removing from the hierarchy. If you need a true called-once-when-created event, use OnInitialized.

destruct() None

Called when a widget is no longer referenced causing the slate resource to destroyed. Just like Construct this event can be called multiple times.

flush_animations() None

Flushes all animations on all widgets to guarantee that any queued updates are processed before this call returns

property foreground_color: SlateColor

[Read-Only] Foreground Color: The foreground color of the widget, this is inherited by sub widgets. Any color property that is marked as inherit will use this color.

Type:

(SlateColor)

get_alignment_in_viewport() Vector2D

Get Alignment in Viewport

Return type:

Vector2D

get_anchors_in_viewport() Anchors

Get Anchors in Viewport

Return type:

Anchors

get_animation_current_time(animation) float

Gets the current time of the animation in this widget

Parameters:

animation (WidgetAnimation) –

Returns:

the current time of the animation.

Return type:

float

get_extension(extension_type) UserWidgetExtension

Find the first extension of the requested type.

Parameters:

extension_type (type(Class)) –

Return type:

UserWidgetExtension

get_extensions(extension_type) Array[UserWidgetExtension]

Find the extensions of the requested type.

Parameters:

extension_type (type(Class)) –

Return type:

Array[UserWidgetExtension]

get_is_visible() bool

Get Is Visible deprecated: Use IsInViewport instead

Return type:

bool

get_owning_player_camera_manager() PlayerCameraManager

Gets the player camera manager associated with this UI.

Returns:

Gets the owning player camera manager that’s owned by the player controller assigned to this widget.

Return type:

PlayerCameraManager

get_owning_player_pawn() Pawn

Gets the player pawn associated with this UI.

Returns:

Gets the owning player pawn that’s owned by the player controller assigned to this widget.

Return type:

Pawn

is_animation_playing(animation) bool

Gets whether an animation is currently playing on this widget.

Parameters:

animation (WidgetAnimation) – The animation to check the playback status of

Returns:

True if the animation is currently playing

Return type:

bool

is_animation_playing_forward(animation) bool

returns true if the animation is currently playing forward, false otherwise.

Parameters:

animation (WidgetAnimation) – The playing animation that we want to know about

Return type:

bool

is_any_animation_playing() bool
Returns:

True if any animation is currently playing

Return type:

bool

property is_focusable: bool

[Read-Write] Is Focusable: Setting this flag to true, allows this widget to accept focus when clicked, or when navigated to.

Type:

(bool)

is_interactable() bool

Gets a value indicating if the widget is interactive.

Return type:

bool

is_listening_for_input_action(action_name) bool

Checks if the action has a registered callback with the input component.

Parameters:

action_name (Name) –

Return type:

bool

is_playing_animation() bool

Are we currently playing any animations?

Return type:

bool

listen_for_input_action(action_name, event_type, consume, callback) None

Listens for a particular Player Input Action by name. This requires that those actions are being executed, and that we’re not currently in UI-Only Input Mode.

Parameters:
on_added_to_focus_path(focus_event) None

If focus is gained on on this widget or on a child widget and this widget is added to the focus path, and wasn’t previously part of it, this event is called.

Parameters:

focus_event (FocusEvent) – FocusEvent

on_analog_value_changed(my_geometry, analog_input_event) EventReply

Called when an analog value changes on a button that supports analog

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • analog_input_event (AnalogInputEvent) – Analog Event

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_animation_finished(animation) None

Called when an animation has either played all the way through or is stopped

Parameters:

animation (WidgetAnimation) – The animation that has finished playing

on_animation_started(animation) None

Called when an animation is started.

Parameters:

animation (WidgetAnimation) – the animation that started

on_drag_cancelled(pointer_event, operation) None

Called when the user cancels the drag operation, typically when they simply release the mouse button after beginning a drag operation, but failing to complete the drag.

Parameters:
  • pointer_event (PointerEvent) – Last mouse event from when the drag was canceled.

  • operation (DragDropOperation) – The drag operation that was canceled.

on_drag_detected(my_geometry, pointer_event) DragDropOperation

Called when Slate detects that a widget started to be dragged.

Parameters:
Returns:

operation (DragDropOperation): The drag operation that was detected.

Return type:

DragDropOperation

on_drag_enter(my_geometry, pointer_event, operation) None

Called during drag and drop when the drag enters the widget.

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • pointer_event (PointerEvent) – The mouse event from when the drag entered the widget.

  • operation (DragDropOperation) – The drag operation that entered the widget.

on_drag_leave(pointer_event, operation) None

Called during drag and drop when the drag leaves the widget.

Parameters:
  • pointer_event (PointerEvent) – The mouse event from when the drag left the widget.

  • operation (DragDropOperation) – The drag operation that entered the widget.

on_drag_over(my_geometry, pointer_event, operation) bool

Called during drag and drop when the the mouse is being dragged over a widget.

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • pointer_event (PointerEvent) – The mouse event from when the drag occurred over the widget.

  • operation (DragDropOperation) – The drag operation over the widget.

Returns:

‘true’ to indicate that you handled the drag over operation. Returning ‘false’ will cause the operation to continue to bubble up.

Return type:

bool

on_drop(my_geometry, pointer_event, operation) bool

Called when the user is dropping something onto a widget. Ends the drag and drop operation, even if no widget handles this.

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • pointer_event (PointerEvent) – The mouse event from when the drag occurred over the widget.

  • operation (DragDropOperation) – The drag operation over the widget.

Returns:

‘true’ to indicate you handled the drop operation.

Return type:

bool

on_focus_lost(focus_event) None

Called when this widget loses focus. This event does not bubble.

Parameters:

focus_event (FocusEvent) – FocusEvent

on_focus_received(my_geometry, focus_event) EventReply

Called when keyboard focus is given to this widget. This event does not bubble.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • focus_event (FocusEvent) – FocusEvent

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_initialized() None

Called once only at game time on non-template instances. While Construct/Destruct pertain to the underlying Slate, this is called only once for the UUserWidget. If you have one-time things to establish up-front (like binding callbacks to events on BindWidget properties), do so here.

on_key_char(my_geometry, character_event) EventReply

Called after a character is entered while this widget has focus

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • character_event (CharacterEvent) – Character event

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_key_down(my_geometry, key_event) EventReply

Called after a key (keyboard, controller, …) is pressed when this widget has focus (this event bubbles if not handled)

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • key_event (KeyEvent) – Key event

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_key_up(my_geometry, key_event) EventReply

Called after a key (keyboard, controller, …) is released when this widget has focus

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • key_event (KeyEvent) – Key event

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_motion_detected(my_geometry, motion_event) EventReply

Called when motion is detected (controller or device) e.g. Someone tilts or shakes their controller.

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • motion_event (MotionEvent) –

Return type:

EventReply

on_mouse_button_double_click(my_geometry, mouse_event) EventReply

Called when a mouse button is double clicked. Override this in derived classes.

Parameters:
Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_mouse_button_down(my_geometry, mouse_event) EventReply

The system calls this method to notify the widget that a mouse button was pressed within it. This event is bubbled.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • mouse_event (PointerEvent) – Information about the input event

Returns:

Whether the event was handled along with possible requests for the system to take action.

Return type:

EventReply

on_mouse_button_up(my_geometry, mouse_event) EventReply

The system calls this method to notify the widget that a mouse button was release within it. This event is bubbled.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • mouse_event (PointerEvent) – Information about the input event

Returns:

Whether the event was handled along with possible requests for the system to take action.

Return type:

EventReply

on_mouse_capture_lost() None

Called when mouse capture is lost if it was owned by this widget.

on_mouse_enter(my_geometry, mouse_event) None

The system will use this event to notify a widget that the cursor has entered it. This event is NOT bubbled.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • mouse_event (PointerEvent) – Information about the input event

on_mouse_leave(mouse_event) None

The system will use this event to notify a widget that the cursor has left it. This event is NOT bubbled.

Parameters:

mouse_event (PointerEvent) – Information about the input event

on_mouse_move(my_geometry, mouse_event) EventReply

The system calls this method to notify the widget that a mouse moved within it. This event is bubbled.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • mouse_event (PointerEvent) – Information about the input event

Returns:

Whether the event was handled along with possible requests for the system to take action.

Return type:

EventReply

on_mouse_wheel(my_geometry, mouse_event) EventReply

Called when the mouse wheel is spun. This event is bubbled.

Parameters:
Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_paint(context) PaintContext

On Paint

Parameters:

context (PaintContext) –

Returns:

context (PaintContext):

Return type:

PaintContext

on_preview_key_down(my_geometry, key_event) EventReply

Called after a key (keyboard, controller, …) is pressed when this widget or a child of this widget has focus If a widget handles this event, OnKeyDown will not be passed to the focused widget.

This event is primarily to allow parent widgets to consume an event before a child widget processes it and it should be used only when there is no better design alternative.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • key_event (KeyEvent) – Key event

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_preview_mouse_button_down(my_geometry, mouse_event) EventReply

Just like OnMouseButtonDown, but tunnels instead of bubbling. If this even is handled, OnMouseButtonDown will not be sent.

Use this event sparingly as preview events generally make UIs more difficult to reason about.

Parameters:
  • my_geometry (Geometry) – The Geometry of the widget receiving the event

  • mouse_event (PointerEvent) – Information about the input event

Returns:

Whether the event was handled along with possible requests for the system to take action.

Return type:

EventReply

on_removed_from_focus_path(focus_event) None

If focus is lost on on this widget or on a child widget and this widget is no longer part of the focus path.

Parameters:

focus_event (FocusEvent) – FocusEvent

on_touch_ended(my_geometry, touch_event) EventReply

Called when a touchpad touch is ended (finger lifted)

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • touch_event (PointerEvent) – The touch event generated

Return type:

EventReply

on_touch_force_changed(my_geometry, touch_event) EventReply

Called when a touchpad force has changed (user pressed down harder or let up)

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • touch_event (PointerEvent) – The touch event generated

Return type:

EventReply

on_touch_gesture(my_geometry, gesture_event) EventReply

Called when the user performs a gesture on trackpad. This event is bubbled.

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • gesture_event (PointerEvent) – gesture event

Returns:

Returns whether the event was handled, along with other possible actions

Return type:

EventReply

on_touch_moved(my_geometry, touch_event) EventReply

Called when a touchpad touch is moved (finger moved)

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • touch_event (PointerEvent) – The touch event generated

Return type:

EventReply

on_touch_started(my_geometry, touch_event) EventReply

Called when a touchpad touch is started (finger down)

Parameters:
  • my_geometry (Geometry) – The geometry of the widget receiving the event.

  • touch_event (PointerEvent) – The touch event generated

Return type:

EventReply

property on_visibility_changed: OnVisibilityChangedEvent

[Read-Write] On Visibility Changed: Called when the visibility has changed

Type:

(OnVisibilityChangedEvent)

property padding: Margin

[Read-Only] Padding: The padding area around the content.

Type:

(Margin)

pause_animation(animation) float

Pauses an already running animation in this widget

Parameters:

animation (WidgetAnimation) –

Returns:

the time point the animation was at when it was paused, relative to its start position. Use this as the StartAtTime when you trigger PlayAnimation.

Return type:

float

play_animation(animation, start_at_time=0.000000, num_loops_to_play=1, play_mode=UMGSequencePlayMode.FORWARD, playback_speed=1.000000, restore_state=False) UMGSequencePlayer

Plays an animation in this widget a specified number of times

Parameters:
  • animation (WidgetAnimation) – The animation to play

  • start_at_time (float) – The time in the animation from which to start playing, relative to the start position. For looped animations, this will only affect the first playback of the animation.

  • num_loops_to_play (int32) – The number of times to loop this animation (0 to loop indefinitely)

  • play_mode (UMGSequencePlayMode) – Specifies the playback mode

  • playback_speed (float) – The speed at which the animation should play

  • restore_state (bool) – Restores widgets to their pre-animated state when the animation stops

Return type:

UMGSequencePlayer

play_animation_at_time(animation: WidgetAnimation, start_at_time: float = 0.0, num_loops_to_play: int = 1, play_mode: UMGSequencePlayMode = Ellipsis, playback_speed: float = 1.0, restore_state: bool = False) UMGSequencePlayer

deprecated: ‘play_animation_at_time’ was renamed to ‘play_animation’.

play_animation_forward(animation, playback_speed=1.000000, restore_state=False) UMGSequencePlayer

Plays an animation on this widget relative to it’s current state forward. You should use this version in situations where say a user can click a button and that causes a panel to slide out, and you want to reverse that same animation to begin sliding in the opposite direction.

Parameters:
  • animation (WidgetAnimation) – The animation to play

  • playback_speed (float) – The speed at which the animation should play

  • restore_state (bool) – Restores widgets to their pre-animated state when the animation stops

Return type:

UMGSequencePlayer

play_animation_reverse(animation, playback_speed=1.000000, restore_state=False) UMGSequencePlayer

Plays an animation on this widget relative to it’s current state in reverse. You should use this version in situations where say a user can click a button and that causes a panel to slide out, and you want to reverse that same animation to begin sliding in the opposite direction.

Parameters:
  • animation (WidgetAnimation) – The animation to play

  • playback_speed (float) – The speed at which the animation should play

  • restore_state (bool) – Restores widgets to their pre-animated state when the animation stops

Return type:

UMGSequencePlayer

play_animation_time_range(animation, start_at_time=0.000000, end_at_time=0.000000, num_loops_to_play=1, play_mode=UMGSequencePlayMode.FORWARD, playback_speed=1.000000, restore_state=False) UMGSequencePlayer

Plays an animation in this widget a specified number of times stopping at a specified time

Parameters:
  • animation (WidgetAnimation) – The animation to play

  • start_at_time (float) – The time in the animation from which to start playing, relative to the start position. For looped animations, this will only affect the first playback of the animation.

  • end_at_time (float) – The absolute time in the animation where to stop, this is only considered in the last loop.

  • num_loops_to_play (int32) – The number of times to loop this animation (0 to loop indefinitely)

  • play_mode (UMGSequencePlayMode) – Specifies the playback mode

  • playback_speed (float) – The speed at which the animation should play

  • restore_state (bool) – Restores widgets to their pre-animated state when the animation stops

Return type:

UMGSequencePlayer

play_animation_to(animation: WidgetAnimation, start_at_time: float = 0.0, end_at_time: float = 0.0, num_loops_to_play: int = 1, play_mode: UMGSequencePlayMode = Ellipsis, playback_speed: float = 1.0, restore_state: bool = False) UMGSequencePlayer

deprecated: ‘play_animation_to’ was renamed to ‘play_animation_time_range’.

play_sound(sound_to_play) None

Plays a sound through the UI deprecated: Use the UGameplayStatics::PlaySound2D instead.

Parameters:

sound_to_play (SoundBase) –

pre_construct(is_design_time) None

Called by both the game and the editor. Allows users to run initial setup for their widgets to better preview the setup in the designer and since generally that same setup code is required at runtime, it’s called there as well.

WARNING This is intended purely for cosmetic updates using locally owned data, you can not safely access any game related state, if you call something that doesn’t expect to be run at editor time, you may crash the editor.

In the event you save the asset with blueprint code that causes a crash on evaluation. You can turn off PreConstruct evaluation in the Widget Designer settings in the Editor Preferences.

Parameters:

is_design_time (bool) –

property priority: int

[Read-Only] Priority

Type:

(int32)

register_input_component() None

ListenForInputAction will automatically Register an Input Component with the player input system. If you however, want to Pause and Resume, listening for a set of actions, the best way is to use UnregisterInputComponent to pause, and RegisterInputComponent to resume listening.

remove_extension(extension) None

Remove the extension.

Parameters:

extension (UserWidgetExtension) –

remove_extensions(extension_type) None

Remove all extensions of the requested type.

Parameters:

extension_type (type(Class)) –

remove_from_viewport() None

Remove from Viewport deprecated: Use RemoveFromParent instead

reverse_animation(animation) None

If an animation is playing, this function will reverse the playback.

Parameters:

animation (WidgetAnimation) – The playing animation that we want to reverse

set_alignment_in_viewport(alignment) None

Set Alignment in Viewport

Parameters:

alignment (Vector2D) –

set_anchors_in_viewport(anchors) None

Set Anchors in Viewport

Parameters:

anchors (Anchors) –

set_animation_current_time(animation, time) None

Sets the current time of the animation in this widget. Does not change state.

Parameters:
set_color_and_opacity(color_and_opacity) None

Sets the tint of the widget, this affects all child widgets.

Parameters:

color_and_opacity (LinearColor) – The tint to apply to all child widgets.

set_desired_size_in_viewport(size) None

Set Desired Size in Viewport

Parameters:

size (Vector2D) –

set_foreground_color(foreground_color) None

Sets the foreground color of the widget, this is inherited by sub widgets. Any color property that is marked as inherit will use this color.

Parameters:

foreground_color (SlateColor) – The foreground color.

set_input_action_blocking(should_block) None

Set Input Action Blocking

Parameters:

should_block (bool) –

set_input_action_priority(new_priority) None

Set Input Action Priority

Parameters:

new_priority (int32) –

set_num_loops_to_play(animation, num_loops_to_play) None

Changes the number of loops to play given a playing animation

Parameters:
  • animation (WidgetAnimation) – The animation that is already playing

  • num_loops_to_play (int32) – The number of loops to play. (0 to loop indefinitely)

set_owning_player(local_player_controller) None

Sets the local player associated with this UI via PlayerController reference.

Parameters:

local_player_controller (PlayerController) – The PlayerController of the local player you want to be the conceptual owner of this UI.

set_padding(padding) None

Sets the padding for the user widget, putting a larger gap between the widget border and it’s root widget.

Parameters:

padding (Margin) –

set_playback_speed(animation, playback_speed=1.000000) None

Changes the playback rate of a playing animation

Parameters:
set_position_in_viewport(position, remove_dpi_scale=True) None

Sets the widgets position in the viewport.

Parameters:
  • 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.

property stop_action: bool

[Read-Write] Stop Action

Type:

(bool)

stop_all_animations() None

Stop All actively running animations.

stop_animation(animation) None

Stops an already running animation in this widget

Parameters:

animation (WidgetAnimation) –

stop_animations_and_latent_actions() None

Cancels any pending Delays or timer callbacks for this widget, and stops all active animations on the widget.

stop_listening_for_all_input_actions() None

Stops listening to all input actions, and unregisters the input component with the player controller.

stop_listening_for_input_action(action_name, event_type) None

Removes the binding for a particular action’s callback.

Parameters:
tick(my_geometry, delta_time) None

Ticks this widget. Override in derived classes, but always call the parent implementation.

Parameters:
  • my_geometry (Geometry) – The space allotted for this widget

  • delta_time (float) – Real time passed since last tick

property tick_frequency: WidgetTickFrequency

[Read-Only] Tick Frequency: This widget is allowed to tick. If this is unchecked tick will never be called, animations will not play correctly, and latent actions will not execute. Uncheck this for performance reasons only

Type:

(WidgetTickFrequency)

unbind_all_from_animation_finished(animation) None

Unbind All from Animation Finished

Parameters:

animation (WidgetAnimation) –

unbind_all_from_animation_started(animation) None

Unbind All from Animation Started

Parameters:

animation (WidgetAnimation) –

unbind_from_animation_finished(animation, delegate) None

Unbind an animation finished delegate.

Parameters:
unbind_from_animation_started(animation, delegate) None

Unbind an animation started delegate.

Parameters:
unregister_input_component() None

StopListeningForAllInputActions will automatically Register an Input Component with the player input system. If you however, want to Pause and Resume, listening for a set of actions, the best way is to use UnregisterInputComponent to pause, and RegisterInputComponent to resume listening.