UWidgetBlueprintLibrary

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Blueprint/WidgetBlueprintLibrary.h

Include

#include "Blueprint/WidgetBlueprintLibrary.h"

Syntax

class UWidgetBlueprintLibrary : public UBlueprintFunctionLibrary

Constructors

Name Description

Public function

UWidgetBlueprintLibrary

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Static

void

 

CancelDragDrop()

Cancels any current drag drop operation.

Public function Static

FEventReply

 

CaptureJoystick

(
    FEventReply& Reply,
    UWidget* CapturingWidget,
    bool bInAllJoysticks
)

Public function Static

FEventReply

 

CaptureMouse

(
    FEventReply& Reply,
    UWidget* CapturingWidget
)

Public function Static

FEventReply

 

ClearUserFocus

(
    FEventReply& Reply,
    bool bInAllUsers
)

Public function Static

UUserWidget ...

 

Create

(
    UObject* WorldContextObject,
    TSubclassOf< class UUserWidget > Wi...,
    APlayerController* OwningPlaye...
)

Creates a widget

Public function Static

UDragDropOpe...

 

CreateDragDropOperation

(
    TSubclassOf< UDragDropOperation > O...
)

Creates a new drag and drop operation that can be returned from a drag begin to inform the UI what i being dragged and dropped and what it looks like.

Public function Static

FEventReply

 

DetectDrag

(
    FEventReply& Reply,
    UWidget* WidgetDetectingDrag,
    FKey DragKey
)

Ask Slate to detect if a user starts dragging in this widget later.

Public function Static

FEventReply

 

DetectDragIfPressed

(
    const FPointerEvent& PointerEvent,
    UWidget* WidgetDetectingDrag,
    FKey DragKey
)

Given the pointer event, emit the DetectDrag reply if the provided key was pressed.

Public function Static

void

 

DismissAllMenus()

Closes any popup menu

Public function Static

void

 

DrawBox

(
    FPaintContext& Context,
    FVector2D Position,
    FVector2D Size,
    USlateBrushAsset* Brush,
    FLinearColor Tint
)

Draws a box

Public function Static

void

 

DrawLine

(
    FPaintContext& Context,
    FVector2D PositionA,
    FVector2D PositionB,
    FLinearColor Tint,
    bool bAntiAlias,
    float Thickness
)

Draws a line.

Public function Static

void

 

DrawLines

(
    FPaintContext& Context,
    const TArray< FVector2D >& Points,
    FLinearColor Tint,
    bool bAntiAlias,
    float Thickness
)

Draws several line segments.

Public function Static

void

 

DrawText

(
    FPaintContext& Context,
    const FString& InString,
    FVector2D Position,
    FLinearColor Tint
)

Draws text.

Public function Static

void

 

DrawTextFormatted

(
    FPaintContext& Context,
    const FText& Text,
    FVector2D Position,
    UFont* Font,
    int32 FontSize,
    FName FontTypeFace,
    FLinearColor Tint
)

Draws text.

Public function Static

FEventReply

 

EndDragDrop

(
    FEventReply& Reply
)

An event should return FReply::Handled().EndDragDrop() to request that the current drag/drop operation be terminated.

Public function Static

void

 

GetAllWidgetsOfClass

(
    UObject* WorldContextObject,
    TArray< UUserWidget* >& Found...,
    TSubclassOf< UUserWidget > WidgetCl...,
    bool TopLevelOnly
)

Find all widgets of a certain class.

Public function Static

void

 

GetAllWidgetsWithInterface

(
    UObject* WorldContextObject,
    TArray< UUserWidget* >& Found...,
    TSubclassOf< UInterface > Interface,
    bool TopLevelOnly
)

Find all widgets in the world with the specified interface.

Public function Static

UObject *...

 

GetBrushResource

(
    const FSlateBrush& Brush
)

Gets the resource object on a brush.

Public function Static

UMaterialInt...

 

GetBrushResourceAsMaterial

(
    const FSlateBrush& Brush
)

Gets the brush resource as a material.

Public function Static

UTexture2D &...

 

GetBrushResourceAsTexture2D

(
    const FSlateBrush& Brush
)

Gets the brush resource as a texture 2D.

Public function Static

UDragDropOpe...

 

GetDragDroppingContent()

Returns the drag and drop operation that is currently occurring if any, otherwise nothing.

Public function Static

UMaterialIns...

 

GetDynamicMaterial

(
    FSlateBrush& Brush
)

Gets the material that allows changes to parameters at runtime.

Public function Static

FInputEvent

 

GetInputEventFromCharacterEvent

(
    const FCharacterEvent& Event
)

Public function Static

FInputEvent

 

GetInputEventFromKeyEvent

(
    const FKeyEvent& Event
)

Public function Static

FInputEvent

 

GetInputEventFromNavigationEvent

(
    const FNavigationEvent& Event
)

Public function Static

FInputEvent

 

GetInputEventFromPointerEvent

(
    const FPointerEvent& Event
)

Public function Static

FKeyEvent

 

GetKeyEventFromAnalogInputEvent

(
    const FAnalogInputEvent& Event
)

Public function Static

void

 

GetSafeZonePadding

(
    UObject* WorldContextObject,
    FVector4& SafePadding,
    FVector2D& SafePaddingScale,
    FVector4& SpillOverPadding
)

Gets the amount of padding that needs to be added when accounting for the safe zone on TVs.

Public function Static

FEventReply

 

Handled()

The event reply to use when you choose to handle an event.

Public function Static

bool

 

IsDragDropping()

Returns true if a drag/drop event is occurring that a widget can handle.

Public function Static

FEventReply

 

LockMouse

(
    FEventReply& Reply,
    UWidget* CapturingWidget
)

Public function Static

FSlateBrush

 

MakeBrushFromAsset

(
    USlateBrushAsset* BrushAsset
)

Creates a Slate Brush from a Slate Brush Asset

Public function Static

FSlateBrush

 

MakeBrushFromMaterial

(
    UMaterialInterface* Material,
    int32 Width,
    int32 Height
)

Creates a Slate Brush from a Material.

Public function Static

FSlateBrush

 

MakeBrushFromTexture

(
    UTexture2D* Texture,
    int32 Width,
    int32 Height
)

Creates a Slate Brush from a Texture2D

Public function Static

FSlateBrush

 

NoResourceBrush()

Creates a Slate Brush that wont draw anything, the "Null Brush".

Public function Static

FEventReply

 

ReleaseJoystickCapture

(
    FEventReply& Reply,
    bool bInAllJoysticks
)

Public function Static

FEventReply

 

ReleaseMouseCapture

(
    FEventReply& Reply
)

Public function Static

void

 

RestorePreviousWindowTitleBarState()

Public function Static

void

 

SetBrushResourceToMaterial

(
    FSlateBrush& Brush,
    UMaterialInterface* Material
)

Sets the resource on a brush to be a Material.

Public function Static

void

 

SetBrushResourceToTexture

(
    FSlateBrush& Brush,
    UTexture2D* Texture
)

Sets the resource on a brush to be a UTexture2D.

Public function Static

void

 

SetColorVisionDeficiencyType

(
    EColorVisionDeficiency Type,
    float Severity,
    bool CorrectDeficiency,
    bool ShowCorrectionWithDeficiency
)

Apply color deficiency correction settings to the game window

Public function Static

void

 

SetFocusToGameViewport()

Public function Static

bool

 

SetHardwareCursor

(
    UObject* WorldContextObject,
    EMouseCursor::Type CursorShape,
    FName CursorName,
    FVector2D HotSpot
)

Loads or sets a hardware cursor from the content directory in the game.

Public function Static

void

 

SetInputMode_GameAndUIEx

(
    APlayerController* PlayerContr...,
    UWidget* InWidgetToFocus,
    EMouseLockMode InMouseLockMode,
    bool bHideCursorDuringCapture
)

Setup an input mode that allows only the UI to respond to user input, and if the UI doesn't handle it player input / player controller gets a chance.

Public function Static

void

 

SetInputMode_GameOnly

(
    APlayerController* PlayerContr...
)

Setup an input mode that allows only player input / player controller to respond to user input.

Public function Static

void

 

SetInputMode_UIOnlyEx

(
    APlayerController* PlayerContr...,
    UWidget* InWidgetToFocus,
    EMouseLockMode InMouseLockMode
)

Setup an input mode that allows only the UI to respond to user input.

Public function Static

FEventReply

 

SetMousePosition

(
    FEventReply& Reply,
    FVector2D NewMousePosition
)

Public function Static

FEventReply

 

SetUserFocus

(
    FEventReply& Reply,
    UWidget* FocusWidget,
    bool bInAllUsers
)

Public function Static

void

 

SetWindowTitleBarCloseButtonActive

(
    bool bActive
)

Public function Static

void

 

SetWindowTitleBarOnCloseClickedDelegate

Public function Static

void

 

SetWindowTitleBarState

(
    UWidget* TitleBarContent,
    EWindowTitleBarMode Mode,
    bool bTitleBarDragEnabled,
    bool bWindowButtonsVisible,
    bool bTitleBarVisible
)

Public function Static

FEventReply

 

Unhandled()

The event reply to use when you choose not to handle an event.

Public function Static

FEventReply

 

UnlockMouse

(
    FEventReply& Reply
)

Classes

Deprecated Functions

Name Description

Public function Static

void

 

SetInputMode_GameAndUI

(
    APlayerController* Target,
    UWidget* InWidgetToFocus,
    bool bLockMouseToViewport,
    bool bHideCursorDuringCapture
)

Locking the mouse to the viewport is now controlled by an enum. Call SetInputMode_GameAndUIEx instead

Public function Static

void

 

SetInputMode_UIOnly

(
    APlayerController* Target,
    UWidget* InWidgetToFocus,
    bool bLockMouseToViewport
)

Locking the mouse to the viewport is now controlled by an enum. Call SetInputMode_UIOnlyEx instead

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss