Widget Studio
UWidgetStudioText Class Reference

A custom text widget setup to work with the Typography Styling. More...

#include <WSText.h>

Inheritance diagram for UWidgetStudioText:
UWidgetStudioBase

Public Member Functions

FWSTextStyle GetTextOptions () const
 Returns all of the text options.
 
FText GetText () const
 Returns the displayed text.
 
bool IsTextEmpty () const
 Returns true if the text is empty.
 
ETextJustify::Type GetJustification () const
 Returns the justification of the text.
 
int32 Length () const
 Returns how long the text is (in characters).
 
EWSFontType GetType () const
 Returns the text type used.
 
FFontStyle GetCustomStyle () const
 Returns the custom text style.
 
bool IsAutoWrappingText () const
 Returns true if the text is automatically being wrapping.
 
float GetWrapTextAt () const
 Returns the set distance to wrap text at.
 
ETextWrappingPolicy GetWrapPolicy () const
 Returns the set wrapping policy.
 
EFontCase GetCase () const
 Returns the set case of the text.
 
void SetTextStyle (FWSTextStyle NewTextOptions)
 Set all of the text options. More...
 
void SetText (FText NewText)
 Set the text that will be displayed by the widget. More...
 
void SetJustification (ETextJustify::Type NewJustification)
 Set the growth direction and alignment of the text. More...
 
void SetColor (EPalette NewColor)
 Set the color of the text. More...
 
void SetType (EWSFontType NewType)
 Set the font type that'll govern the style of the text. More...
 
void SetCustomStyle (FFontStyle NewStyle)
 Set the custom font style. More...
 
void SetAutoWrapText (bool NewState)
 Set the text to automatically wrap or not. More...
 
void SetWrapTextAt (float NewWrapAt)
 Set where to wrap the text at. More...
 
void SetWrapPolicy (ETextWrappingPolicy NewPolicy)
 Set how the text should be wrapped. More...
 
void SetCase (EFontCase NewCase)
 Set the case style of the text. More...
 
- Public Member Functions inherited from UWidgetStudioBase
FVector2D GetDimensions () const
 Returns the current X and Y dimensions of the Widget. More...
 
int32 GetBorderRadius () const
 Returns the current border radius of the Widget. More...
 
void ForceStyleUpdate ()
 Refresh the dynamic styling of the Widget Studio widget.
 
void SetSizeModifier (ESizeModifier InSizeModifier)
 Set the size modifier of the Widget Studio widget.
 

Protected Member Functions

virtual TSharedRef< SWidget > RebuildWidget () override
 
virtual int32 NativePaint (const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override
 
virtual void SynchronizeProperties () override
 
virtual void InitializeStyling () override
 
virtual void UpdateStyling () override
 
- Protected Member Functions inherited from UWidgetStudioBase
virtual void NativeOnMouseEnter (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 
virtual void NativeOnMouseLeave (const FPointerEvent &InMouseEvent) override
 
virtual void NativeOnMouseCaptureLost (const FCaptureLostEvent &CaptureLostEvent) override
 

Protected Attributes

FSlateFontInfo FontInfo
 
USizeBox * SizeBox = nullptr
 
UWidgetStudioTextBlockTextItem = nullptr
 
FText Text = FText::FromString("Placeholder")
 The text that is displayed.
 
FWSTextStyle TextStyle
 The display options for the text. More...
 
EPalette Color = EPalette::PrimaryContent
 The color of the text.
 
EWSFontType Type = EWSFontType::Body1
 The font type that'll govern the style of the text.
 
FFontStyle CustomStyle
 A custom font style. More...
 
EFontCase Case = EFontCase::Sentence
 Set the case style of the text that is displayed.
 
TEnumAsByte< ETextJustify::Type > Justification = ETextJustify::Left
 The growth direction and alignment of the text.
 
bool AutoWrapText = false
 Automatically wraps the text to the next line when it reaches the end of available horizontal space.
 
float WrapTextAt = 0
 Manually wraps the text at the given distance. More...
 
ETextWrappingPolicy WrappingPolicy = ETextWrappingPolicy::DefaultWrapping
 How the text should wrap.
 

Additional Inherited Members

- Public Attributes inherited from UWidgetStudioBase
FWSBaseHoverStateDelegate OnHoverStateChanged
 Called when the hover state has been changed.
 
bool bCanOverrideDimensions = true
 Used to enable or disable dimension override's.
 
bool bCanOverrideBorderRadius = true
 Used to enable or disable dimension override's.
 
FVector2D MinimumDimensions = FVector2D(50, 7)
 The minimum dimensions of the widget. More...
 
bool bDisablePainting = false
 Used for debugging. More...
 
float AnimationTime = 7
 The animation interpolation speed. More...
 
ESizeModifier SizeModifier = ESizeModifier::Regular
 Quickly modify the overall size of the widget. More...
 
FVector2D OverrideDimensions = FVector2D(0, 0)
 Manually adjust the X and Y dimensions of the widget. More...
 
int32 OverrideBorderRadius = -1
 Manually adjust the border radius of the widget. More...
 

Detailed Description

A custom text widget setup to work with the Typography Styling.

Member Function Documentation

◆ InitializeStyling()

void UWidgetStudioText::InitializeStyling ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioBase.

◆ SetAutoWrapText()

void UWidgetStudioText::SetAutoWrapText ( bool  NewState)

Set the text to automatically wrap or not.

Parameters
NewStateThe new auto wrap state to apply to the text.

◆ SetCase()

void UWidgetStudioText::SetCase ( EFontCase  NewCase)

Set the case style of the text.

Parameters
NewCaseThe new case to apply to the text.

◆ SetColor()

void UWidgetStudioText::SetColor ( EPalette  NewColor)

Set the color of the text.

Parameters
NewColorThe new color to apply to the text.

◆ SetCustomStyle()

void UWidgetStudioText::SetCustomStyle ( FFontStyle  NewStyle)

Set the custom font style.

Will only take effect if the Font Type is set to Custom.

Parameters
NewStyleThe new font style to apply to the text.

◆ SetJustification()

void UWidgetStudioText::SetJustification ( ETextJustify::Type  NewJustification)

Set the growth direction and alignment of the text.

Parameters
NewJustificationThe new text justification to apply to the text.

◆ SetText()

void UWidgetStudioText::SetText ( FText  NewText)

Set the text that will be displayed by the widget.

Parameters
NewTextThe new text to display on the widget.

◆ SetTextStyle()

void UWidgetStudioText::SetTextStyle ( FWSTextStyle  NewTextOptions)

Set all of the text options.

Parameters
NewTextOptionsThe new text options to set.

◆ SetType()

void UWidgetStudioText::SetType ( EWSFontType  NewType)

Set the font type that'll govern the style of the text.

Parameters
NewTypeThe new font type to apply to the text.

◆ SetWrapPolicy()

void UWidgetStudioText::SetWrapPolicy ( ETextWrappingPolicy  NewPolicy)

Set how the text should be wrapped.

Parameters
NewPolicyThe new wrap policy to apply to the text.

◆ SetWrapTextAt()

void UWidgetStudioText::SetWrapTextAt ( float  NewWrapAt)

Set where to wrap the text at.

Ignored if set to 0.

Parameters
NewWrapAtThe new wrap at location.

◆ UpdateStyling()

void UWidgetStudioText::UpdateStyling ( )
overrideprotectedvirtual

Reimplemented from UWidgetStudioBase.

Member Data Documentation

◆ CustomStyle

FFontStyle UWidgetStudioText::CustomStyle
protected

A custom font style.

Useful for one-off styles.

◆ TextStyle

FWSTextStyle UWidgetStudioText::TextStyle
protected

The display options for the text.

Will eventually replace the base variables.

◆ WrapTextAt

float UWidgetStudioText::WrapTextAt = 0
protected

Manually wraps the text at the given distance.

Ignored if set to 0.


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