DeskSim v2 0.1
Train simulator prototype created for Lokførerskolen
Public Member Functions | Public Attributes | List of all members
UObjectWidget Class Reference

The Content browser asset holding class. More...

#include <ObjectWidget.h>

Inheritance diagram for UObjectWidget:

Public Member Functions

 UObjectWidget (const FObjectInitializer &ObjectInitializer)
 Gets the player controller and sets mouse editing enabled. More...
 
virtual FReply NativeOnMouseButtonDown (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent) override
 notifies when the right mouse button is down. More...
 
virtual void NativeOnDragDetected (const FGeometry &InGeometry, const FPointerEvent &InMouseEvent, UDragDropOperation *&OutOperation) override
 Creates a drag operation if a drag is detected from the widget. More...
 
virtual void NativeOnDragCancelled (const FDragDropEvent &InDragDropEvent, UDragDropOperation *InOperation) override
 Recieves a drag event that si canceled. More...
 
void SetTitleText (FString Text)
 Set's the title text of the widget. More...
 
void SetDescriptionText (FString Text)
 Sets the description of the widget. More...
 
void SetImageResource (UTexture2D *Texture)
 Sets the 2D texture of the object. More...
 
void SetActorResource (TSubclassOf< AActor > Actor)
 Sets the actor resource of the widget. More...
 

Public Attributes

class UImage * ImageObject
 Binding for image in object widget.
 
class UTextBlock * TitleText
 Binding for title text in object widget.
 
class UTextBlock * DescriptionText
 Binding for description text in object widget.
 
class UButton * ScenarioButton
 Binding for scenario button in object widget.
 
TSubclassOf< class UUserWidget > DraggedObjectWidgetClass
 The object widget class.
 
TSubclassOf< AActor > ReferencedActor
 The actor recieved from EditorHUD.
 
APlayerController * PC
 The player controller.
 
TArray< AActor * > AllActors
 all the actors created in the editor.
 

Detailed Description

The Content browser asset holding class.

Constructor & Destructor Documentation

◆ UObjectWidget()

UObjectWidget::UObjectWidget ( const FObjectInitializer &  ObjectInitializer)

Gets the player controller and sets mouse editing enabled.

Parameters
ObjectInitializer- Basic userwidget initializer

Member Function Documentation

◆ NativeOnDragCancelled()

void UObjectWidget::NativeOnDragCancelled ( const FDragDropEvent &  InDragDropEvent,
UDragDropOperation *  InOperation 
)
overridevirtual

Recieves a drag event that si canceled.

Finds the player position and cast's a ray from there in a straight line to the ground. The ray hit rocation is stored in the Hit variable and this is used to place a new actor on the level. .

Parameters
InDragDropEvent
InOperation

◆ NativeOnDragDetected()

void UObjectWidget::NativeOnDragDetected ( const FGeometry &  InGeometry,
const FPointerEvent &  InMouseEvent,
UDragDropOperation *&  OutOperation 
)
overridevirtual

Creates a drag operation if a drag is detected from the widget.

Parameters
InGeometry- The geometry
InMouseEvent- Mouse event
OutOperation- The drag operation

◆ NativeOnMouseButtonDown()

FReply UObjectWidget::NativeOnMouseButtonDown ( const FGeometry &  InGeometry,
const FPointerEvent &  InMouseEvent 
)
overridevirtual

notifies when the right mouse button is down.

Parameters
InGeometry- The geometry of the event.
InMouseEvent- The actual mouse event.
Returns
NativeReply of the mouse event.

◆ SetActorResource()

void UObjectWidget::SetActorResource ( TSubclassOf< AActor >  Actor)

Sets the actor resource of the widget.

Parameters
Actor- The incoming actor reference

◆ SetDescriptionText()

void UObjectWidget::SetDescriptionText ( FString  Text)

Sets the description of the widget.

Parameters
Text- The incoming description

◆ SetImageResource()

void UObjectWidget::SetImageResource ( UTexture2D *  Texture)

Sets the 2D texture of the object.

Parameters
Texture- The incoming texture

◆ SetTitleText()

void UObjectWidget::SetTitleText ( FString  Text)

Set's the title text of the widget.

Parameters
Text- The incoming title

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