VisualU 1.3.1
Plugin for Unreal Engine 5 that brings core functionality for a widget-based visual novel game
 
Loading...
Searching...
No Matches
SVisualImageBase< DerivedT > Class Template Reference

Base slate class for widgets that can display some render resource. More...

#include <SVisualImageBase.h>

Inheritance diagram for SVisualImageBase< DerivedT >:

Protected Member Functions

virtual FSlateBrush ConvertToBrush () const final
 Handles conversion of the render resource to the slate brush.
 
virtual int32 OnPaint (const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override final
 Paints render resource as a brush after applying all modifiers.
 
bool IsResourceValid () const
 Used during resource-to-brush conversion to stop it early when resource is invalid.
 
UObject * GetFinalResource () const
 Resource to be displayed by the widget.
 
const FVector2D GetImageSize () const
 
const FLinearColor GetFinalColorAndOpacity (const FWidgetStyle &InWidgetStyle) const
 
void PreSlateDrawElementExtension () const
 Optional extension to the SVisualImageBase::OnPaint template.
 
FGeometry MakeCustomGeometry (const FGeometry &AllotedGeometry) const
 
void PostSlateDrawElementExtension () const
 Optional extension to the SVisualImageBase::OnPaint template.
 

Private Member Functions

 SVisualImageBase ()=default
 It is an abstract class, can't be constructed.
 
 SVisualImageBase (SVisualImageBase const &)=delete
 
SVisualImageBaseoperator= (SVisualImageBase const &)=delete
 

Private Attributes

friend DerivedT
 

Detailed Description

template<class DerivedT>
class SVisualImageBase< DerivedT >

Base slate class for widgets that can display some render resource.

Utilizes CRTP with double dispatch for derived classes, template function is SVisualImageBase::ConvertToBrush.

Parameters
DerivedTderived class of SVisualImageBase
See also
UVisualImageBase

Member Function Documentation

◆ ConvertToBrush()

template<class DerivedT >
FSlateBrush SVisualImageBase< DerivedT >::ConvertToBrush ( ) const
inlinefinalprotectedvirtual

Handles conversion of the render resource to the slate brush.

Note
this function is finalized
Returns
slate brush made from SVisualImageBase::GetFinalResource()

◆ GetFinalColorAndOpacity()

template<class DerivedT >
const FLinearColor SVisualImageBase< DerivedT >::GetFinalColorAndOpacity ( const FWidgetStyle & InWidgetStyle) const
inlineprotected
Parameters
InWidgetStylebase widget style
Returns
color and opacity to be applied to the resource

◆ GetFinalResource()

template<class DerivedT >
UObject * SVisualImageBase< DerivedT >::GetFinalResource ( ) const
inlineprotected

Resource to be displayed by the widget.

Returns
render resource

◆ GetImageSize()

template<class DerivedT >
const FVector2D SVisualImageBase< DerivedT >::GetImageSize ( ) const
inlineprotected
Returns
slate size of the resource

◆ IsResourceValid()

template<class DerivedT >
bool SVisualImageBase< DerivedT >::IsResourceValid ( ) const
inlineprotected

Used during resource-to-brush conversion to stop it early when resource is invalid.

Returns
validity of the supplied resource

◆ MakeCustomGeometry()

template<class DerivedT >
FGeometry SVisualImageBase< DerivedT >::MakeCustomGeometry ( const FGeometry & AllotedGeometry) const
inlineprotected
Parameters
AllotedGeometrybase geometry for this widget
Returns
geometry of this widget

◆ OnPaint()

template<class DerivedT >
int32 SVisualImageBase< DerivedT >::OnPaint ( const FPaintArgs & Args,
const FGeometry & AllottedGeometry,
const FSlateRect & MyCullingRect,
FSlateWindowElementList & OutDrawElements,
int32 LayerId,
const FWidgetStyle & InWidgetStyle,
bool bParentEnabled ) const
inlinefinaloverrideprotectedvirtual

Paints render resource as a brush after applying all modifiers.

Parameters
Argscontains information about paint of this widget
AllottedGeometrybase geometry for this widget
MyCullingRectculling bounds of this widget
OutDrawElementselements to draw in the slate window
LayerIdlayer on which elements should be drawn
InWidgetStylebase widget appearance info
bParentEnabledis parent widget enabled

◆ PostSlateDrawElementExtension()

template<class DerivedT >
void SVisualImageBase< DerivedT >::PostSlateDrawElementExtension ( ) const
inlineprotected

Optional extension to the SVisualImageBase::OnPaint template.

Called after render resource is drawn.

◆ PreSlateDrawElementExtension()

template<class DerivedT >
void SVisualImageBase< DerivedT >::PreSlateDrawElementExtension ( ) const
inlineprotected

Optional extension to the SVisualImageBase::OnPaint template.

Called before render resource is drawn.


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