A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SDialogueNodeOverlayWidget.cpp
Go to the documentation of this file.
1
// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2
#include "
SDialogueNodeOverlayWidget.h
"
3
4
#include "Widgets/SOverlay.h"
5
#include "Widgets/Layout/SBox.h"
6
#include "Widgets/Layout/SBorder.h"
7
8
#include "
DialogueStyle.h
"
9
11
// SDialogueNodeOverlayWidget
12
void
SDialogueNodeOverlayWidget::Construct
(
const
FArguments& InArgs)
13
{
14
OnHoverStateChangedEvent
= InArgs._OnHoverStateChanged;
15
OnGetBackgroundColorEvent
= InArgs._OnGetBackgroundColor;
16
OverlayBody
= InArgs._OverlayBody.Get();
17
18
const
FSlateBrush* CircleBrush =
FDialogueStyle::Get
()->GetBrush(
FDialogueStyle::PROPERTY_GraphNodeCircleBox
);
19
ChildSlot
20
[
21
SNew(SOverlay)
22
+SOverlay::Slot()
23
.HAlign(HAlign_Fill)
24
.VAlign(VAlign_Fill)
25
[
26
// Add a dummy box here to make sure the widget doesnt get smaller than the brush
27
SNew(SBox)
28
.WidthOverride(CircleBrush->ImageSize.X)
29
.HeightOverride(CircleBrush->ImageSize.Y)
30
]
31
32
+SOverlay::Slot()
33
.HAlign(HAlign_Fill)
34
.VAlign(VAlign_Fill)
35
[
36
SNew(
SBorder
)
37
.BorderImage(CircleBrush)
38
.BorderBackgroundColor(
this
, &
Self::GetBackgroundColor
)
39
.Padding(FMargin(4.0f))
40
.VAlign(VAlign_Center)
41
.HAlign(HAlign_Center)
42
[
43
OverlayBody
.ToSharedRef()
44
]
45
]
46
];
47
}
DialogueStyle.h
SDialogueNodeOverlayWidget.h
FDialogueStyle::PROPERTY_GraphNodeCircleBox
static const FName PROPERTY_GraphNodeCircleBox
Definition
DialogueStyle.h:53
FDialogueStyle::Get
static TSharedPtr< ISlateStyle > Get()
Definition
DialogueStyle.h:14
SBorder
SDialogueNodeOverlayWidget::OverlayBody
TSharedPtr< SWidget > OverlayBody
Definition
SDialogueNodeOverlayWidget.h:58
SDialogueNodeOverlayWidget::OnGetBackgroundColorEvent
FOnGetBackgroundColor OnGetBackgroundColorEvent
Definition
SDialogueNodeOverlayWidget.h:55
SDialogueNodeOverlayWidget::Construct
void Construct(const FArguments &InArgs)
Definition
SDialogueNodeOverlayWidget.cpp:12
SDialogueNodeOverlayWidget::GetBackgroundColor
FSlateColor GetBackgroundColor() const
Definition
SDialogueNodeOverlayWidget.h:42
SDialogueNodeOverlayWidget::OnHoverStateChangedEvent
FOnHoverStateChanged OnHoverStateChangedEvent
Definition
SDialogueNodeOverlayWidget.h:52
SDKDemo
Plugins
UnrealEngineSDK
VisualScripter
Source
DlgSystemEditor
Private
DialogueEditor
Nodes
SDialogueNodeOverlayWidget.cpp
Generated
Wed Oct 9 2024 19:52:55
by Doxygen version
1.10.0