Widget Studio
UWidgetStudioFunctionLibrary Class Reference

A collection of useful Widget Studio functions. More...

#include <WSFunctionLibrary.h>

Inheritance diagram for UWidgetStudioFunctionLibrary:

Static Public Member Functions

static FLinearColor GetColorFromPalette (EPalette Color)
 Returns the FLinearColor value of the given Palette Color. More...
 
static FLinearColor GetColorBasedValue (float ValuePercent, bool bReverseOrder=false)
 Returns friendly to hostile color based on the value given. More...
 
static EPalette GetPaletteBasedValue (float ValuePercent, bool bReverseOrder=false)
 Returns friendly to hostile color based on the value given. More...
 
static UTexture2D * GetTextureFromIconLibrary (EIconItem Icon)
 Returns the texture from the icon library.
 
static FVector2D GetControlDimensions ()
 Returns the control dimensions from the Widget Studio Subsystem.
 
static float GetSizeByModifier (const ESizeModifier Modifier, const float InSize)
 Modifies and returns the given size based upon the modifier. More...
 
static float GetBorderRadius ()
 Returns the border radius from the Widget Studio Subsystem.
 
static UWidgetStudioThemeGetCurrentTheme ()
 Returns the current theme in use by the Widget Studio.
 
static UWidgetStudioTypographyGetCurrentTypography ()
 Returns the current typography in use by the Widget Studio.
 
static UWidgetStudioIconSetGetCurrentIconSet ()
 Returns the current icon set in use by the Widget Studio.
 
static bool SetTheme (const TSoftObjectPtr< UWidgetStudioTheme > NewTheme)
 Sets the theme to use with the Widget Studio. More...
 
static bool SetTypography (const TSoftObjectPtr< UWidgetStudioTypography > NewTypography)
 Sets the typography to use with the Widget Studio. More...
 
static bool SetIconSet (const TSoftObjectPtr< UWidgetStudioIconSet > NewIconSet)
 Sets the icon set to use with the Widget Studio. More...
 
static FSlateBrush GetRoundedSlateBrush ()
 Returns the Widget Studio stylized slate brush. More...
 
static FScrollBarStyle GetScrollBarStyle ()
 Returns the Widget Studio stylized scroll bar style.
 
static void InterpWidgetColor (UUserWidget *Widget, EPalette TargetColor, float Speed)
 Smoothly interpolate the widget's color and opacity. More...
 
static void InterpImageColor (UImage *Widget, EPalette TargetColor, float Speed)
 Smoothly interpolate the image widget's color and opacity. More...
 
static void InterpTextColor (UTextBlock *Widget, EPalette TargetColor, float Speed)
 Smoothly interpolate the text widget's color and opacity. More...
 
static void InterpEditableTextBoxColor (UEditableTextBox *Widget, EPalette TargetColor, float Speed)
 Smoothly interpolate the text widget's color and opacity. More...
 
static void InterpSizeBoxOverrides (USizeBox *Widget, float TargetWidth, float TargetHeight, float Speed, bool bIgnoreZero=true)
 Smoothly interpolate the dimension overrides of the size box. More...
 
static void InterpSizeBoxMinOverrides (USizeBox *Widget, float TargetWidth, float TargetHeight, float Speed)
 Smoothly interpolate the dimension minimum overrides of the size box. More...
 
static void InterpWidgetTranslation (UWidget *Widget, const FVector2D TargetTranslation, const float Speed)
 Smoothly interpolate the widgets render translation. More...
 
static void InterpWidgetScale (UWidget *Widget, const FVector2D TargetScale, const float Speed)
 Smoothly interpolate the widgets render translation. More...
 
static void InterpWidgetRotation (UWidget *Widget, const float TargetRotation, const float Speed)
 Smoothly interpolate the widgets render rotation. More...
 
static void InterpWidgetOpacity (UWidget *Widget, float TargetOpacity, float Speed)
 Smoothly interpolate the widgets render opacity. More...
 
static void InterpBrushImageSize (UImage *Image, float TargetWidth, float TargetHeight, float Speed)
 Smoothly interpolate the brush image size. More...
 
static UMaterialInterface * GetRoundedBackgroundMaterial ()
 Return a reference to the Rounded Background Material.
 
static UMaterialInterface * GetRoundedOutlineMaterial ()
 Return a reference to the Rounded Outline Material.
 
static UMaterialInterface * GetRoundedShadowMaterial ()
 Return a reference to the Rounded Shadow Material.
 
static UFont * GetTypefaceFromTypography ()
 Return the current Typeface.
 
static bool ContainsNumbers (FText InText)
 Checks if the text contains any number.
 
static FText FilterByCharacterLimit (const FText InText, const int32 CharacterLimit)
 Checks if the text contains any number.
 
static FSlateFontInfo ConstructFontInfoFromTypography (const EWSFontType FontType)
 Create Font Info from Typography type.
 
static FSlateFontInfo ConstructFontInfoFromStyle (const FFontStyle FontStyle)
 Create Font Info.
 
static FFontStyle GetTypeScaleFromTypography (const EWSFontType FontType)
 Returns the type scale from the Typography.
 
static FName GetFontWeightName (EFontWeight FontWeight)
 Returns the font weight name.
 
static float GetAdjustedPercent (float Value, float Min, float Max)
 Retrieve adjusted percent float value by converting a given range to [0:1] and a value within that range to 0 <= X <= 1. More...
 

Detailed Description

A collection of useful Widget Studio functions.

Member Function Documentation

◆ GetAdjustedPercent()

float UWidgetStudioFunctionLibrary::GetAdjustedPercent ( float  Value,
float  Min,
float  Max 
)
static

Retrieve adjusted percent float value by converting a given range to [0:1] and a value within that range to 0 <= X <= 1.

Passed in values may be negative.

Parameters
Valuethe current value
Minthe minimum value in the range
Maxthe maximum value in the range
Returns
the adjusted percent value between 0 and 1

◆ GetColorBasedValue()

FLinearColor UWidgetStudioFunctionLibrary::GetColorBasedValue ( float  ValuePercent,
bool  bReverseOrder = false 
)
static

Returns friendly to hostile color based on the value given.

The default color order is — [0] Friendly -> Warning -> Error [1]

Parameters
ValuePercentThe 0 - 1 value in which to grade the color value.
bReverseOrderReverses the color order. If set to true, the order will be [0] Error -> Warning -> Friendly [1]

◆ GetColorFromPalette()

FLinearColor UWidgetStudioFunctionLibrary::GetColorFromPalette ( EPalette  Color)
static

Returns the FLinearColor value of the given Palette Color.

Returns
FLinearColor

◆ GetPaletteBasedValue()

EPalette UWidgetStudioFunctionLibrary::GetPaletteBasedValue ( float  ValuePercent,
bool  bReverseOrder = false 
)
static

Returns friendly to hostile color based on the value given.

The default color order is — [0] Friendly -> Warning -> Error [1]

Parameters
ValuePercentThe 0 - 1 value in which to grade the color value.
bReverseOrderReverses the color order. If set to true, the order will be [0] Error -> Warning -> Friendly [1]

◆ GetRoundedSlateBrush()

FSlateBrush UWidgetStudioFunctionLibrary::GetRoundedSlateBrush ( )
static

Returns the Widget Studio stylized slate brush.

Returns
A rounded slate brush styled by Widget Studio.

◆ GetSizeByModifier()

float UWidgetStudioFunctionLibrary::GetSizeByModifier ( const ESizeModifier  Modifier,
const float  InSize 
)
static

Modifies and returns the given size based upon the modifier.

  • Mini: 55%
  • Tiny: 70%
  • Small: 85%
  • Regular: 100%
  • Large: 115%
  • Big: 130%
  • Huge: 145%
  • Massive: 160%

◆ InterpBrushImageSize()

void UWidgetStudioFunctionLibrary::InterpBrushImageSize ( UImage *  Image,
float  TargetWidth,
float  TargetHeight,
float  Speed 
)
static

Smoothly interpolate the brush image size.

Setting Speed to 0 will skip the interp.

◆ InterpEditableTextBoxColor()

void UWidgetStudioFunctionLibrary::InterpEditableTextBoxColor ( UEditableTextBox *  Widget,
EPalette  TargetColor,
float  Speed 
)
static

Smoothly interpolate the text widget's color and opacity.

Setting Speed to 0 will skip the interp.

◆ InterpImageColor()

void UWidgetStudioFunctionLibrary::InterpImageColor ( UImage *  Widget,
EPalette  TargetColor,
float  Speed 
)
static

Smoothly interpolate the image widget's color and opacity.

Setting Speed to 0 will skip the interp.

◆ InterpSizeBoxMinOverrides()

void UWidgetStudioFunctionLibrary::InterpSizeBoxMinOverrides ( USizeBox *  Widget,
float  TargetWidth,
float  TargetHeight,
float  Speed 
)
static

Smoothly interpolate the dimension minimum overrides of the size box.

Setting Speed to 0 will skip the interp.

◆ InterpSizeBoxOverrides()

void UWidgetStudioFunctionLibrary::InterpSizeBoxOverrides ( USizeBox *  Widget,
float  TargetWidth,
float  TargetHeight,
float  Speed,
bool  bIgnoreZero = true 
)
static

Smoothly interpolate the dimension overrides of the size box.

Setting Speed to 0 will skip the interp.

◆ InterpTextColor()

void UWidgetStudioFunctionLibrary::InterpTextColor ( UTextBlock *  Widget,
EPalette  TargetColor,
float  Speed 
)
static

Smoothly interpolate the text widget's color and opacity.

Setting Speed to 0 will skip the interp.

◆ InterpWidgetColor()

void UWidgetStudioFunctionLibrary::InterpWidgetColor ( UUserWidget *  Widget,
EPalette  TargetColor,
float  Speed 
)
static

Smoothly interpolate the widget's color and opacity.

Setting Speed to 0 will skip the interp.

◆ InterpWidgetOpacity()

void UWidgetStudioFunctionLibrary::InterpWidgetOpacity ( UWidget *  Widget,
float  TargetOpacity,
float  Speed 
)
static

Smoothly interpolate the widgets render opacity.

Setting Speed to 0 will skip the interp.

◆ InterpWidgetRotation()

void UWidgetStudioFunctionLibrary::InterpWidgetRotation ( UWidget *  Widget,
const float  TargetRotation,
const float  Speed 
)
static

Smoothly interpolate the widgets render rotation.

Setting Speed to 0 will skip the interp.

◆ InterpWidgetScale()

void UWidgetStudioFunctionLibrary::InterpWidgetScale ( UWidget *  Widget,
const FVector2D  TargetScale,
const float  Speed 
)
static

Smoothly interpolate the widgets render translation.

Setting Speed to 0 will skip the interp.

◆ InterpWidgetTranslation()

void UWidgetStudioFunctionLibrary::InterpWidgetTranslation ( UWidget *  Widget,
const FVector2D  TargetTranslation,
const float  Speed 
)
static

Smoothly interpolate the widgets render translation.

Setting Speed to 0 will skip the interp.

◆ SetIconSet()

bool UWidgetStudioFunctionLibrary::SetIconSet ( const TSoftObjectPtr< UWidgetStudioIconSet NewIconSet)
static

Sets the icon set to use with the Widget Studio.

Widget Studio widgets will dynamically adjust. Returns true if icon set was successfully applied.

Precondition
IconSet passed in must point to a valid data asset
Postcondition
Passed in IconSet data asset will be loaded (if not already) and applied as the global icon set
OnStyleChanged event will be broadcast, so WS Settings are updated
Parameters
NewIconSet- the IconSet to set
Returns
true if IconSet is successfully set, false otherwise

◆ SetTheme()

bool UWidgetStudioFunctionLibrary::SetTheme ( const TSoftObjectPtr< UWidgetStudioTheme NewTheme)
static

Sets the theme to use with the Widget Studio.

Widget Studio widgets will dynamically adjust. Returns true if theme was successfully applied.

Precondition
Theme passed in must point to a valid data asset
Postcondition
Passed in Theme data asset will be loaded (if not already) and applied as the global theme
OnStyleChanged event will be broadcast, so WS Settings are updated
Parameters
NewTheme- the Theme to set
Returns
true if Theme is successfully set, false otherwise

◆ SetTypography()

bool UWidgetStudioFunctionLibrary::SetTypography ( const TSoftObjectPtr< UWidgetStudioTypography NewTypography)
static

Sets the typography to use with the Widget Studio.

Widget Studio widgets will dynamically adjust. Returns true if typography was successfully applied.

Precondition
Typography passed in must point to a valid data asset
Postcondition
Passed in Typography data asset will be loaded (if not already) and applied as the global typography
OnStyleChanged event will be broadcast, so WS Settings are updated
Parameters
NewTypography- the Typography to set
Returns
true if Typography is successfully set, false otherwise

The documentation for this class was generated from the following files: