unreal.CommonActivatableWidget
¶
- class unreal.CommonActivatableWidget(outer=None, name='None')¶
Bases:
unreal.CommonUserWidget
The base for widgets that are capable of being “activated” and “deactivated” during their lifetime without being otherwise modified or destroyed.
- This is generally desired for one or more of the following purposes:
This widget can turn on/off without being removed from the hierarchy (or otherwise reconstructing the underlying SWidgets), so Construct/Destruct are insufficient
You’d like to be able to “go back” from this widget, whether that means back a breadcrumb, closing a modal, or something else. This is built-in here.
This widget’s place in the hierarchy is such that it defines a meaningful node-point in the tree of activatable widgets through which input is routed to all widgets.
- By default, an activatable widget:
Is not automatically activated upon construction
Does not register to receive back actions (or any other actions, for that matter)
If classified as a back handler, is automatically deactivated (but not destroyed) when it receives a back action
Note that removing an activatable widget from the UI (i.e. triggering Destruct()) will always deactivate it, even if the UWidget is not destroyed. Re-constructing the underlying SWidget will only result in re-activation if auto-activate is enabled.
TODO: ADD MORE INFO ON INPUTS
C++ Source:
Plugin: CommonUI
Module: CommonUI
File: CommonActivatableWidget.h
Editor Properties: (see get_editor_property/set_editor_property)
accessible_behavior
(SlateAccessibleBehavior): [Read-Write] 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] 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] When AccessibleSummaryBehavior is set to Custom, this is the text that will be used to describe the widget.accessible_text
(Text): [Read-Write] When AccessibleBehavior is set to Custom, this is the text that will be used to describe the widget.activated_visibility
(SlateVisibility): [Read-Write] Activated Visibilityauto_activate
(bool): [Read-Write] True to automatically activate upon constructionauto_restore_focus
(bool): [Read-Write] True to prefer automatically restoring focus to the widget that was focused when this widget last became the non-leafmost-active-widget. If true and a valid restoration candidate exists, we’ll use that. If it doesn’t, we rely on GetDesiredFocusTarget() If false, we simply always rely on GetDesiredFocusTarget()bp_on_widget_activated
(OnWidgetActivationChanged): [Read-Write] Fires when the widget is activated.bp_on_widget_deactivated
(OnWidgetActivationChanged): [Read-Write] Fires when the widget is deactivated.can_children_be_accessible
(bool): [Read-Write] Whether or not children of this widget can appear as distinct accessible widgets.clipping
(WidgetClipping): [Read-Write] Controls how the clipping behavior of this widget. Normally content that overflows the bounds of the widget continues rendering. Enabling clipping prevents that overflowing content from being seen.NOTE: Elements in different clipping spaces can not be batched together, and so there is a performance cost to clipping. Do not enable clipping unless a panel actually needs to prevent content from showing up outside its bounds.
color_and_opacity
(LinearColor): [Read-Write] The color and opacity of this widget. Tints all child widgets.consume_pointer_input
(bool): [Read-Write] Set this to true if you don’t want any pointer (mouse and touch) input to bubble past this widgetcursor
(MouseCursor): [Read-Write] The cursor to show when the mouse is over the widgetdeactivated_visibility
(SlateVisibility): [Read-Write] Deactivated Visibilityflow_direction_preference
(FlowDirectionPreference): [Read-Write] Allows you to set a new flow directionforeground_color
(SlateColor): [Read-Write] 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_active
(bool): [Read-Write] Is Activeis_back_handler
(bool): [Read-Write] True to receive “Back” actions automatically. Custom back handler behavior can be provided, default is to deactivate.is_enabled
(bool): [Read-Write] Sets whether this widget can be modified interactively by the useris_focusable
(bool): [Read-Write] Setting this flag to true, allows this widget to accept focus when clicked, or when navigated to.is_modal
(bool): [Read-Write] True to have this widget be treated as a root node for input routing, regardless of its actual parentage. Should seldom be needed, but useful in cases where a child widget should prevent all action processing by parents, even though they remain active (ex: modal popup menu).is_volatile
(bool): [Read-Write] 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] 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] Called when the visibility has changedoverride_accessible_defaults
(bool): [Read-Write] Override all of the default accessibility behavior and text for this widget.override_cursor
(bool): [Read-Write] Override Cursorpadding
(Margin): [Read-Write] The padding area around the content.preview_background
(Texture2D): [Read-Write] 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] Priorityrender_opacity
(float): [Read-Write] The opacity of the widgetrender_transform
(WidgetTransform): [Read-Write] The render transform of the widget allows for arbitrary 2D transforms to be applied to the widget.render_transform_pivot
(Vector2D): [Read-Write] The render transform pivot controls the location about which transforms are applied. This value is a normalized coordinate about which things like rotations will occur.set_visibility_on_activated
(bool): [Read-Write] Set Visibility on Activatedset_visibility_on_deactivated
(bool): [Read-Write] Set Visibility on Deactivatedslot
(PanelSlot): [Read-Write] The parent slot of the UWidget. Allows us to easily inline edit the layout controlling this widget.stop_action
(bool): [Read-Write] Stop Actionsupports_activation_focus
(bool): [Read-Write] True if this widget is a candidate to receive/route focus or specify a desired UIInputConfig when active. Primary reason for disabling is for utility sub-widgets within a larger screen that possess actions, but are never intended to be involved in navigation or dictate changes to the active UI input config.tick_frequency
(WidgetTickFrequency): [Read-Write] 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 onlytool_tip_text
(Text): [Read-Write] Tooltip text to show when the user hovers over the widget with the mousetool_tip_widget
(Widget): [Read-Only] Tooltip widget to show when the user hovers over the widget with the mousevisibility
(SlateVisibility): [Read-Write] The visibility of the widget
- bp_get_desired_focus_target() → Widget¶
Implement to provide the desired widget to focus if/when this activatable becomes the primary active widget. Note: This is a fallback used only if the native class parentage does not provide a target.
- Returns
- Return type
- bp_on_handle_back_action() → bool¶
Override in BP implementations to provide custom behavior when receiving a back action Note: Only called if native code in the base class hasn’t handled it in NativeOnHandleBackAction
- Returns
- Return type
- property bp_on_widget_activated¶
[Read-Write] Fires when the widget is activated.
- Type
- property bp_on_widget_deactivated¶
[Read-Write] Fires when the widget is deactivated.
- Type