Class Widget
This is the base class for all wrapped Slate controls that are exposed to UObjects.
Inheritance
Inherited Members
Namespace: UE4.UMG
Assembly: UE4DotNet.dll
Syntax
public class Widget : Visual
Properties
| Improve this Doc View SourcebCreatedByConstructionScript
Declaration
public bool bCreatedByConstructionScript { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bExpandedInDesigner
Declaration
public bool bExpandedInDesigner { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bHiddenInDesigner
Declaration
public bool bHiddenInDesigner { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bIsEnabled
Declaration
public bool bIsEnabled { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bIsVariable
Declaration
public bool bIsVariable { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bIsVolatile
Declaration
public bool bIsVolatile { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bLockedInDesigner
Declaration
public bool bLockedInDesigner { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
bOverride_Cursor
Declaration
public bool bOverride_Cursor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Cursor
The cursor to show when the mouse is over the widget
Declaration
public byte Cursor { get; }
Property Value
| Type | Description |
|---|---|
| System.Byte |
DefaultObject
Get UE4 Default Object for this Class
Declaration
public static Widget DefaultObject { get; }
Property Value
| Type | Description |
|---|---|
| Widget |
DesignerFlags
Any flags used by the designer at edit time.
Declaration
public byte DesignerFlags { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Byte |
NativeBindings
Native property bindings.
Declaration
public ObjectArrayField<PropertyBinding> NativeBindings { get; }
Property Value
| Type | Description |
|---|---|
| ObjectArrayField<PropertyBinding> |
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.
Declaration
public WidgetNavigation Navigation { get; }
Property Value
| Type | Description |
|---|---|
| WidgetNavigation |
Remarks
Those rules determine how navigation transitions can occur between widgets.
RenderOpacity
The opacity of the widget
Declaration
public float RenderOpacity { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
RenderTransform
The render transform of the widget allows for arbitrary 2D transforms to be applied to the widget.
Declaration
public WidgetTransform RenderTransform { get; }
Property Value
| Type | Description |
|---|---|
| WidgetTransform |
RenderTransformPivot
The render transform pivot controls the location about which transforms are applied.
Declaration
public Vector2D RenderTransformPivot { get; }
Property Value
| Type | Description |
|---|---|
| Vector2D |
Remarks
This value is a normalized coordinate about which things like rotations will occur.
Slot
The parent slot of the UWidget. Allows us to easily inline edit the layout controlling this widget.
Declaration
public PanelSlot Slot { get; }
Property Value
| Type | Description |
|---|---|
| PanelSlot |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
| Type | Description |
|---|---|
| Class |
ToolTipWidget
Tooltip widget to show when the user hovers over the widget with the mouse
Declaration
public Widget ToolTipWidget { get; }
Property Value
| Type | Description |
|---|---|
| Widget |
Methods
| Improve this Doc View SourceForceLayoutPrepass()
Forces a pre-pass.
Declaration
public void ForceLayoutPrepass()
Remarks
A pre-pass caches the desired size of the widget hierarchy owned by this widget. One pre-pass is already happens for every widget before Tick occurs. You only need to perform another pre-pass if you are adding child widgets this frame and want them to immediately be visible this frame.
ForceVolatile(Boolean)
Sets the forced volatility of the widget.
Declaration
public void ForceVolatile(bool bForce)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bForce |
GetCachedGeometry(Geometry)
Gets the last geometry used to Tick the widget.
Declaration
public void GetCachedGeometry(Geometry ReturnValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | ReturnValue |
Remarks
This data may not exist yet if this call happens prior to the widget having been ticked/painted, or it may be out of date, or a frame behind.
We recommend not to use this data unless there's no other way to solve your problem. Normally in Slate we try and handle these issues by making a dependent widget part of the hierarchy, as to avoid frame behind or what are referred to as hysteresis problems, both caused by depending on geometry from the previous frame being used to advise how to layout a dependent object the current frame.
GetClipping()
Gets the clipping state of this widget.
Declaration
public EWidgetClipping GetClipping()
Returns
| Type | Description |
|---|---|
| EWidgetClipping |
GetDesiredSize()
Gets the widgets desired size.
Declaration
public Vector2D GetDesiredSize()
Returns
| Type | Description |
|---|---|
| Vector2D |
Remarks
NOTE: The underlying Slate widget must exist and be valid, also at least one pre-pass must have occurred before this value will be of any use.
@return The widget's desired size
GetIsEnabled()
Gets the current enabled status of the widget
Declaration
public bool GetIsEnabled()
Returns
| Type | Description |
|---|---|
| System.Boolean |
GetOwningLocalPlayer()
Gets the local player associated with this UI.
Declaration
public LocalPlayer GetOwningLocalPlayer()
Returns
| Type | Description |
|---|---|
| LocalPlayer |
Remarks
@return The owning local player.
GetOwningPlayer()
Gets the player controller associated with this UI.
Declaration
public PlayerController GetOwningPlayer()
Returns
| Type | Description |
|---|---|
| PlayerController |
Remarks
@return The player controller that owns the UI.
GetParent()
Gets the parent widget
Declaration
public PanelWidget GetParent()
Returns
| Type | Description |
|---|---|
| PanelWidget |
GetRenderOpacity()
Gets the current visibility of the widget.
Declaration
public float GetRenderOpacity()
Returns
| Type | Description |
|---|---|
| System.Single |
GetVisibility()
Gets the current visibility of the widget.
Declaration
public ESlateVisibility GetVisibility()
Returns
| Type | Description |
|---|---|
| ESlateVisibility |
HasAnyUserFocus()
@return true if this widget is focused by any user.
Declaration
public bool HasAnyUserFocus()
Returns
| Type | Description |
|---|---|
| System.Boolean |
HasFocusedDescendants()
@return true if any descendant widget is focused by any user.
Declaration
public bool HasFocusedDescendants()
Returns
| Type | Description |
|---|---|
| System.Boolean |
HasKeyboardFocus()
Checks to see if this widget currently has the keyboard focus @
Declaration
public bool HasKeyboardFocus()
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
return True if this widget has keyboard focus
HasMouseCapture()
Checks to see if this widget is the current mouse captor @
Declaration
public bool HasMouseCapture()
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
return True if this widget has captured the mouse
HasMouseCaptureByUser(Int32, Int32)
Checks to see if this widget is the current mouse captor @
Declaration
public bool HasMouseCaptureByUser(int UserIndex, int PointerIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | UserIndex | |
| System.Int32 | PointerIndex |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remarks
param User index to check for capture @param Optional pointer index to check for capture @return True if this widget has captured the mouse with given user and pointer
HasUserFocus(PlayerController)
@return true if this widget is focused by a specific user.
Declaration
public bool HasUserFocus(PlayerController PlayerController)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerController | PlayerController |
Returns
| Type | Description |
|---|---|
| System.Boolean |
HasUserFocusedDescendants(PlayerController)
@return true if any descendant widget is focused by a specific user.
Declaration
public bool HasUserFocusedDescendants(PlayerController PlayerController)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerController | PlayerController |
Returns
| Type | Description |
|---|---|
| System.Boolean |
InvalidateLayoutAndVolatility()
Invalidates the widget from the view of a layout caching widget that may own this widget.
Declaration
public void InvalidateLayoutAndVolatility()
Remarks
will force the owning widget to redraw and cache children on the next paint pass.
IsHovered()
@return true if the widget is currently being hovered by a pointer device
Declaration
public bool IsHovered()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsVisible()
@return true if the widget is Visible, HitTestInvisible or SelfHitTestInvisible.
Declaration
public bool IsVisible()
Returns
| Type | Description |
|---|---|
| System.Boolean |
New(UObject, Name)
Spawn an object of this class
Declaration
public static Widget New(UObject obj = null, Name name = default(Name))
Parameters
| Type | Name | Description |
|---|---|---|
| UObject | obj | |
| Name | name |
Returns
| Type | Description |
|---|---|
| Widget |
RemoveFromParent()
Removes the widget from its parent widget.
Declaration
public void RemoveFromParent()
Remarks
If this widget was added to the player's screen or the viewport it will also be removed from those containers.
ResetCursor()
Resets the cursor to use on the widget, removing any customization for it.
Declaration
public void ResetCursor()
SetAllNavigationRules(EUINavigationRule, Name)
Sets the widget navigation rules for all directions.
Declaration
public void SetAllNavigationRules(EUINavigationRule Rule, Name WidgetToFocus)
Parameters
| Type | Name | Description |
|---|---|---|
| EUINavigationRule | Rule | |
| Name | WidgetToFocus |
Remarks
This can only be called on widgets that are in a widget tree. @param Rule The rule to use when navigation is taking place @param WidgetToFocus When using the Explicit rule, focus on this widget
SetClipping(EWidgetClipping)
Sets the clipping state of this widget.
Declaration
public void SetClipping(EWidgetClipping InClipping)
Parameters
| Type | Name | Description |
|---|---|---|
| EWidgetClipping | InClipping |
SetCursor(Byte)
Sets the cursor to show over the widget.
Declaration
public void SetCursor(byte InCursor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | InCursor |
SetIsEnabled(Boolean)
Sets the current enabled status of the widget
Declaration
public void SetIsEnabled(bool bInIsEnabled)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bInIsEnabled |
SetKeyboardFocus()
Sets the focus to this widget.
Declaration
public void SetKeyboardFocus()
SetNavigationRule(EUINavigation, EUINavigationRule, Name)
Sets the widget navigation rules for a specific direction.
Declaration
public void SetNavigationRule(EUINavigation Direction, EUINavigationRule Rule, Name WidgetToFocus)
Parameters
| Type | Name | Description |
|---|---|---|
| EUINavigation | Direction | |
| EUINavigationRule | Rule | |
| Name | WidgetToFocus |
Remarks
This can only be called on widgets that are in a widget tree. @param Direction @param Rule The rule to use when navigation is taking place @param WidgetToFocus When using the Explicit rule, focus on this widget
SetRenderAngle(Single)
Set Render Angle
Declaration
public void SetRenderAngle(float Angle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | Angle |
SetRenderOpacity(Single)
Sets the visibility of the widget.
Declaration
public void SetRenderOpacity(float InOpacity)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | InOpacity |
SetRenderScale(Vector2D)
Set Render Scale
Declaration
public void SetRenderScale(Vector2D Scale)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2D | Scale |
SetRenderShear(Vector2D)
Set Render Shear
Declaration
public void SetRenderShear(Vector2D Shear)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2D | Shear |
SetRenderTransform(WidgetTransform)
Set Render Transform
Declaration
public void SetRenderTransform(WidgetTransform InTransform)
Parameters
| Type | Name | Description |
|---|---|---|
| WidgetTransform | InTransform |
SetRenderTransformPivot(Vector2D)
Set Render Transform Pivot
Declaration
public void SetRenderTransformPivot(Vector2D Pivot)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2D | Pivot |
SetRenderTranslation(Vector2D)
Set Render Translation
Declaration
public void SetRenderTranslation(Vector2D Translation)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2D | Translation |
SetToolTip(Widget)
Sets a custom widget as the tooltip of the widget.
Declaration
public void SetToolTip(Widget Widget)
Parameters
| Type | Name | Description |
|---|---|---|
| Widget | Widget |
SetToolTipText(Byte)
Sets the tooltip text for the widget.
Declaration
public void SetToolTipText(byte InToolTipText)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte | InToolTipText |
SetUserFocus(PlayerController)
Sets the focus to this widget for a specific user
Declaration
public void SetUserFocus(PlayerController PlayerController)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerController | PlayerController |
SetVisibility(ESlateVisibility)
Sets the visibility of the widget.
Declaration
public void SetVisibility(ESlateVisibility InVisibility)
Parameters
| Type | Name | Description |
|---|---|---|
| ESlateVisibility | InVisibility |
Operators
| Improve this Doc View SourceImplicit(IntPtr to Widget)
Convert from IntPtr to UObject
Declaration
public static implicit operator Widget(IntPtr p)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | p |
Returns
| Type | Description |
|---|---|
| Widget |