Widget that can visualize and animate sprite flipbooks. More...
#include <VisualImage.h>
Public Member Functions | |
| UVisualImage (const FObjectInitializer &ObjectInitializer) | |
| DECLARE_DYNAMIC_DELEGATE_RetVal (UPaperFlipbook *, FGetPaperFlipbook) | |
| virtual void | ReleaseSlateResources (bool bReleaseChildren) override |
| Releases memory allocated for slate widgets. | |
| virtual void | AssignVisualImageInfo (const FVisualImageInfo &InInfo) override |
| Applies received information to this image. | |
| void | SetAnimate (bool IsAnimated) |
| Setter for UVisualController::bAnimate. | |
| void | SetFrameIndex (int Index) |
| Setter for UVisualImage::FrameIndex. | |
| void | SetFlipbook (UPaperFlipbook *InFlipbook) |
| Synchronous setter for flipbook. | |
| void | SetFlipbookAsync (TSoftObjectPtr< UPaperFlipbook > InFlipbook) |
| Asynchronous setter for flipbook. | |
| void | CancelAsyncLoad () |
| Releases streamed flipbook. | |
| bool | IsFlipbookLoading () const |
| bool | IsFlipbookLoaded () const |
| void | SetColorAndOpacity (const FLinearColor &InColorAndOpacity) |
| Setter for UVisualImage::ColorAndOpacity. | |
| void | SetDesiredScale (const FVector2D &InDesiredScale) |
| Setter for UVisualImage::DesiredScale. | |
| void | SetMirrorScale (const FVector2D &InMirrorScale) |
| Setter for UVisualImage::MirrorScale. | |
| FORCEINLINE UPaperFlipbook * | GetFlipbook () const |
| FORCEINLINE bool | IsAnimated () const |
| FORCEINLINE int32 | GetFrameIndex () const |
| FORCEINLINE FLinearColor | GetColorAndOpacity () const |
| FORCEINLINE FVector2D | GetDesiredScale () const |
| FORCEINLINE FVector2D | GetMirrorScale () const |
| UPaperSprite * | GetCurrentSprite () const |
Protected Member Functions | |
| virtual void | SynchronizeProperties () override |
| Keeps C++ and derived blueprint classes synced in the widget designer. | |
| virtual TSharedRef< SWidget > | RebuildWidget () override |
| TSharedPtr< FStreamableHandle > | AsyncLoadFlipbook (TSoftObjectPtr< UPaperFlipbook > FlipbookToLoad, FStreamableDelegate AfterLoadDelegate, TAsyncLoadPriority Priority) |
| Asynchronously stream soft flipbook in the memory. | |
| const UPaperFlipbook * | ToFlipbook (TAttribute< UPaperFlipbook * > InFlipbook) const |
| Converts flipbook attribute to the flipbook pointer. | |
| PROPERTY_BINDING_IMPLEMENTATION (FSlateColor, ColorAndOpacity) | |
Protected Member Functions inherited from UVisualImageBase | |
| UVisualImageBase (const FObjectInitializer &ObjectInitializer) | |
| Abstract, cannot be instantiated. | |
Protected Attributes | |
| TObjectPtr< UPaperFlipbook > | Flipbook |
| Paper flipbook to visualize. | |
| FGetPaperFlipbook | FlipbookDelegate |
| Delegate for property binding of the flipbook. | |
| FLinearColor | ColorAndOpacity |
| Color and opacity of the flipbook. | |
| FGetLinearColor | ColorAndOpacityDelegate |
| Delegate for property binding of the color and opacity. | |
| FVector2D | DesiredScale |
| Scale of the flipbook. | |
| FVector2D | MirrorScale |
| Determines the orientation of the sprite on both axes. | |
| bool | bAnimate |
| Decides whether or not flipbook's animation sequence should be played. | |
| int32 | FrameIndex |
| Index of the flipbook's frame that must be rendered. | |
| TSharedPtr< FStreamableHandle > | FlipbookHandle |
| Handle to the streamable flipbook. | |
| TSharedPtr< SVisualImage > | VisualImageSlate |
| Underlying slate visual image. | |
Widget that can visualize and animate sprite flipbooks.
Visual image operates on UPaperFlipbook class which is provided by Paper2D built-in plugin. Supports asynchronous loading of soft flipbooks.
|
overridevirtual |
Applies received information to this image.
| InInfo | information for this visual image |
|
protected |
Asynchronously stream soft flipbook in the memory.
Will trigger assertion for invalid soft flipbook.
| FlipbookToLoad | soft flipbook to stream in memory |
| AfterLoadDelegate | delegate to execute after loading is complete |
| Priority | how urgent is loading of the soft flipbook |
| void UVisualImage::CancelAsyncLoad | ( | ) |
Releases streamed flipbook.
|
inline |
| UPaperSprite * UVisualImage::GetCurrentSprite | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool UVisualImage::IsFlipbookLoaded | ( | ) | const |
true when streaming has finished. | bool UVisualImage::IsFlipbookLoading | ( | ) | const |
true when streaming is still in progress.
|
overrideprotectedvirtual |
Reimplemented in UBackgroundVisualImage.
|
overridevirtual |
Releases memory allocated for slate widgets.
| bReleaseChildren | should memory of child widgets be released |
Reimplemented in UBackgroundVisualImage.
| void UVisualImage::SetAnimate | ( | bool | IsAnimated | ) |
Setter for UVisualController::bAnimate.
| IsAnimated | new flipbook animation state |
| void UVisualImage::SetColorAndOpacity | ( | const FLinearColor & | InColorAndOpacity | ) |
Setter for UVisualImage::ColorAndOpacity.
| InColorAndOpacity | new color and opacity of the flipbook |
| void UVisualImage::SetDesiredScale | ( | const FVector2D & | InDesiredScale | ) |
Setter for UVisualImage::DesiredScale.
| InDesiredScale | new desired scale of the flipbook |
| void UVisualImage::SetFlipbook | ( | UPaperFlipbook * | InFlipbook | ) |
Synchronous setter for flipbook.
| InFlipbook | new flipbook to display |
| void UVisualImage::SetFlipbookAsync | ( | TSoftObjectPtr< UPaperFlipbook > | InFlipbook | ) |
Asynchronous setter for flipbook.
| InFlipbook | new soft flipbook to display |
| void UVisualImage::SetFrameIndex | ( | int | Index | ) |
Setter for UVisualImage::FrameIndex.
| Index | index of frame to display |
| void UVisualImage::SetMirrorScale | ( | const FVector2D & | InMirrorScale | ) |
Setter for UVisualImage::MirrorScale.
| InMirrorScale | new mirror scale of the flipbook |
|
protected |
Converts flipbook attribute to the flipbook pointer.
Used to implement property binding of the flipbook.
| InFlipbook | flipbook attribute to convert |
|
protected |
Color and opacity of the flipbook.
|
protected |
Scale of the flipbook.
Must be larger than zero on both axes.
|
protected |
Delegate for property binding of the flipbook.
|
protected |
Index of the flipbook's frame that must be rendered.
Ignored when UVisualImage::bAnimate is true.
|
protected |
Determines the orientation of the sprite on both axes.
Only -1 or 1 values are valid.
|
protected |
Underlying slate visual image.