Agrarsense
|
#include <WindowActor.h>
Public Member Functions | |
AWindowActor (const FObjectInitializer &ObjectInitializer) | |
void | SetupWindow (int Width=1280, int Height=720, FString Title="Window", UTextureRenderTarget2D *TextureRenderTarget=nullptr) |
void | SetupTextureRenderTarget (UTextureRenderTarget2D *TextureRenderTarget) |
void | AddWidgetToWindow (UWidget *WidgetToAdd) |
void | RemoveWidgetFromWindow (UWidget *WidgetToAdd) |
void | ResizeWindow (int Width=1280, int Height=720) |
TSharedPtr< FUnrealWindow > | GetUnrealWindow () |
Public Attributes | |
FOnWindowClosed | OnWindowClosedDelegate |
Protected Member Functions | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
Private Member Functions | |
void | OnWindowClosed (const TSharedRef< SWindow > &Window) |
Private Attributes | |
TSharedPtr< FUnrealWindow > | UnrealWindow |
Example Actor how to use FUnrealWindow to modify and create custom Window. Usage example: Create new blueprint based on this Actor - At blueprint BeginPlay call SetupWindow. To Add/Remove widgets call AddWidgetToWindow/RemoveWidgetFromWindow. To Resize window call ResizeWindow.
Definition at line 26 of file WindowActor.h.
AWindowActor::AWindowActor | ( | const FObjectInitializer & | ObjectInitializer | ) |
Definition at line 8 of file WindowActor.cpp.
void AWindowActor::AddWidgetToWindow | ( | UWidget * | WidgetToAdd | ) |
Definition at line 57 of file WindowActor.cpp.
References UnrealWindow.
|
overrideprotectedvirtual |
Definition at line 39 of file WindowActor.cpp.
|
overrideprotectedvirtual |
Definition at line 44 of file WindowActor.cpp.
References OnWindowClosedDelegate, and UnrealWindow.
|
inline |
Definition at line 49 of file WindowActor.h.
|
private |
Definition at line 81 of file WindowActor.cpp.
References Destroy.
Referenced by SetupWindow().
void AWindowActor::RemoveWidgetFromWindow | ( | UWidget * | WidgetToAdd | ) |
Definition at line 65 of file WindowActor.cpp.
References UnrealWindow.
void AWindowActor::ResizeWindow | ( | int | Width = 1280 , |
int | Height = 720 |
||
) |
Definition at line 73 of file WindowActor.cpp.
References UnrealWindow.
void AWindowActor::SetupTextureRenderTarget | ( | UTextureRenderTarget2D * | TextureRenderTarget | ) |
Definition at line 31 of file WindowActor.cpp.
References UnrealWindow.
Referenced by SetupWindow().
void AWindowActor::SetupWindow | ( | int | Width = 1280 , |
int | Height = 720 , |
||
FString | Title = "Window" , |
||
UTextureRenderTarget2D * | TextureRenderTarget = nullptr |
||
) |
Definition at line 13 of file WindowActor.cpp.
References OnWindowClosed(), OnWindowClosedDelegate, SetupTextureRenderTarget(), and UnrealWindow.
FOnWindowClosed AWindowActor::OnWindowClosedDelegate |
Definition at line 54 of file WindowActor.h.
Referenced by EndPlay(), and SetupWindow().
|
private |
Definition at line 66 of file WindowActor.h.
Referenced by AddWidgetToWindow(), EndPlay(), RemoveWidgetFromWindow(), ResizeWindow(), SetupTextureRenderTarget(), and SetupWindow().