KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
UImageButton 클래스 참조

UImageButton 더 자세히 ...

#include <UImageButton.h>

+ UImageButton에 대한 상속 다이어그램 :
+ UImageButton에 대한 협력 다이어그램:

Public 멤버 함수

void SetButtonEnabled (bool bInEnabled)
 버튼의 활성화/비활성화 상태를 설정합니다.
 

Public 속성

TEnumAsByte< ESlateBrushDrawType::Type > BorderDrawAs = ESlateBrushDrawType::Image
 Border 이미지의 그리기 방식 (Image, Box, Border, RoundedBox 등)
 
UTexture2D * BorderImage = nullptr
 Border에 적용할 이미지 (null이면 색상만 사용)
 
FMargin BorderMargin = FMargin(0.0f)
 Border 이미지의 여백 (9-slice 방식으로 그릴 때 사용)
 
bool bUseFixedSize = false
 고정 크기 사용 여부
 
float FixedHeight = 100.0f
 고정 높이 (bUseFixedSize가 true일 때 적용)
 
float FixedWidth = 200.0f
 고정 너비 (bUseFixedSize가 true일 때 적용)
 
int32 FontOutlineSize = 0
 
int32 FontSize = 48
 
FLinearColor HoverButtonColor = FLinearColor(0.2f, 0.2f, 0.2f)
 
FLinearColor HoverTextColor = FLinearColor(0.8f, 0.9f, 1.f)
 
FText LabelText = FText::FromString("Button")
 
FLinearColor NormalButtonColor = FLinearColor(0.1f, 0.1f, 0.1f)
 
FLinearColor NormalTextColor = FLinearColor::White
 
FOnImageButtonClickedEvent OnButtonClickedEvent
 버튼 클릭 시 발생하는 이벤트
 
FLinearColor PressButtonColor = FLinearColor(0.05f, 0.05f, 0.05f)
 
FLinearColor PressTextColor = FLinearColor(0.6f, 0.7f, 1.f)
 

Protected 멤버 함수

virtual void NativeConstruct () override
 
virtual void NativePreConstruct () override
 
virtual void NativeTick (const FGeometry &MyGeometry, float InDeltaTime) override
 

Private 멤버 함수

void ApplyStyle ()
 설정된 스타일 속성을 위젯에 적용합니다.
 
void HandleClicked ()
 
void HandleHovered ()
 
void HandlePressed ()
 
void HandleReleased ()
 
void HandleUnhovered ()
 

Private 속성

bool bBorderBrushInitialized = false
 
bool bEnabled = true
 
class UBorder * Border_BG
 
class UButton * Button_Main
 
FSlateBrush CachedBorderBrush
 
float CurrentBrightness = 1.0f
 
FVector2D CurrentScale = FVector2D(1.f, 1.f)
 
float LerpSpeed = 20.f
 
class USizeBox * SizeBox_Root
 
float TargetBrightness = 1.f
 
FVector2D TargetScale = FVector2D(1.f, 1.f)
 
class UTextBlock * Text_Label
 

상세한 설명

UImageButton

UHoverButton과 동일한 호버/프레스 애니메이션 기능을 제공하며, 추가로 Border 이미지 설정 및 고정 크기 설정이 가능한 버튼 위젯입니다.

UImageButton.h 파일의 18 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ ApplyStyle()

void UImageButton::ApplyStyle ( )
private

설정된 스타일 속성을 위젯에 적용합니다.

UImageButton.cpp 파일의 37 번째 라인에서 정의되었습니다.

38{
39 // ========== 텍스트 스타일 적용 ==========
40 if (Text_Label)
41 {
42 Text_Label->SetText(LabelText);
43
44 FSlateFontInfo NewFont = Text_Label->GetFont();
45 NewFont.OutlineSettings.OutlineSize = FontOutlineSize;
46 NewFont.Size = FontSize;
47 Text_Label->SetFont(NewFont);
48
49 Text_Label->SetColorAndOpacity(NormalTextColor);
50 }
51
52 // ========== Border 배경 및 이미지 적용 ==========
53 if (Border_BG)
54 {
55 // Border 이미지가 설정되어 있으면 이미지 사용
56 if (BorderImage)
57 {
58 CachedBorderBrush.SetResourceObject(BorderImage);
61 CachedBorderBrush.TintColor = FSlateColor(NormalButtonColor);
64 }
65 else
66 {
67 // 이미지가 없으면 색상만 사용
68 Border_BG->SetBrushColor(NormalButtonColor);
70 }
71 }
72
73 // ========== 고정 크기 적용 ==========
74 if (SizeBox_Root)
75 {
76 if (bUseFixedSize)
77 {
78 SizeBox_Root->SetWidthOverride(FixedWidth);
79 SizeBox_Root->SetHeightOverride(FixedHeight);
80 }
81 else
82 {
83 // 고정 크기를 사용하지 않으면 자동 크기 조정
84 SizeBox_Root->ClearWidthOverride();
85 SizeBox_Root->ClearHeightOverride();
86 }
87 }
88}
int32 FontOutlineSize
class USizeBox * SizeBox_Root
float FixedHeight
고정 높이 (bUseFixedSize가 true일 때 적용)
FLinearColor NormalTextColor
FSlateBrush CachedBorderBrush
class UTextBlock * Text_Label
FLinearColor NormalButtonColor
FMargin BorderMargin
Border 이미지의 여백 (9-slice 방식으로 그릴 때 사용)
bool bUseFixedSize
고정 크기 사용 여부
class UBorder * Border_BG
float FixedWidth
고정 너비 (bUseFixedSize가 true일 때 적용)
TEnumAsByte< ESlateBrushDrawType::Type > BorderDrawAs
Border 이미지의 그리기 방식 (Image, Box, Border, RoundedBox 등)
UTexture2D * BorderImage
Border에 적용할 이미지 (null이면 색상만 사용)
bool bBorderBrushInitialized

다음을 참조함 : bBorderBrushInitialized, Border_BG, BorderDrawAs, BorderImage, BorderMargin, bUseFixedSize, CachedBorderBrush, FixedHeight, FixedWidth, FontOutlineSize, FontSize, LabelText, NormalButtonColor, NormalTextColor, SizeBox_Root, Text_Label.

다음에 의해서 참조됨 : NativePreConstruct().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ HandleClicked()

void UImageButton::HandleClicked ( )
private

UImageButton.cpp 파일의 191 번째 라인에서 정의되었습니다.

192{
193 if (!bEnabled)
194 return;
195
196 OnButtonClickedEvent.Broadcast();
197}
FOnImageButtonClickedEvent OnButtonClickedEvent
버튼 클릭 시 발생하는 이벤트

다음을 참조함 : bEnabled, OnButtonClickedEvent.

다음에 의해서 참조됨 : NativeConstruct().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ HandleHovered()

void UImageButton::HandleHovered ( )
private

UImageButton.cpp 파일의 99 번째 라인에서 정의되었습니다.

100{
101 if (!bEnabled)
102 return;
103
104 TargetScale = FVector2D(1.06f, 1.06f);
105 TargetBrightness = 1.15f;
106
107 if (Text_Label)
108 {
109 Text_Label->SetColorAndOpacity(HoverTextColor);
110 }
111
112 if (Border_BG)
113 {
115 {
116 // 이미지가 있으면 Tint 색상 변경
117 CachedBorderBrush.TintColor = FSlateColor(HoverButtonColor);
118 Border_BG->SetBrush(CachedBorderBrush);
119 }
120 else
121 {
122 Border_BG->SetBrushColor(HoverButtonColor);
123 }
124 }
125}
float TargetBrightness
FLinearColor HoverButtonColor
FLinearColor HoverTextColor
FVector2D TargetScale

다음을 참조함 : bBorderBrushInitialized, bEnabled, Border_BG, BorderImage, CachedBorderBrush, HoverButtonColor, HoverTextColor, TargetBrightness, TargetScale, Text_Label.

다음에 의해서 참조됨 : HandleReleased(), NativeConstruct().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ HandlePressed()

void UImageButton::HandlePressed ( )
private

UImageButton.cpp 파일의 154 번째 라인에서 정의되었습니다.

155{
156 if (!bEnabled)
157 return;
158
159 TargetScale = FVector2D(0.97f, 0.97f);
160
161 if (Text_Label)
162 {
163 Text_Label->SetColorAndOpacity(PressTextColor);
164 }
165
166 if (Border_BG)
167 {
169 {
170 CachedBorderBrush.TintColor = FSlateColor(PressButtonColor);
171 Border_BG->SetBrush(CachedBorderBrush);
172 }
173 else
174 {
175 Border_BG->SetBrushColor(PressButtonColor);
176 }
177 }
178}
FLinearColor PressButtonColor
FLinearColor PressTextColor

다음을 참조함 : bBorderBrushInitialized, bEnabled, Border_BG, BorderImage, CachedBorderBrush, PressButtonColor, PressTextColor, TargetScale, Text_Label.

다음에 의해서 참조됨 : NativeConstruct().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ HandleReleased()

void UImageButton::HandleReleased ( )
private

UImageButton.cpp 파일의 180 번째 라인에서 정의되었습니다.

181{
182 if (!bEnabled)
183 return;
184
185 if (Button_Main && Button_Main->IsHovered())
187 else
189}
void HandleUnhovered()
void HandleHovered()
class UButton * Button_Main

다음을 참조함 : bEnabled, Button_Main, HandleHovered(), HandleUnhovered().

다음에 의해서 참조됨 : NativeConstruct().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ HandleUnhovered()

void UImageButton::HandleUnhovered ( )
private

UImageButton.cpp 파일의 127 번째 라인에서 정의되었습니다.

128{
129 if (!bEnabled)
130 return;
131
132 TargetScale = FVector2D(1.0f, 1.0f);
133 TargetBrightness = 1.0f;
134
135 if (Text_Label)
136 {
137 Text_Label->SetColorAndOpacity(NormalTextColor);
138 }
139
140 if (Border_BG)
141 {
143 {
144 CachedBorderBrush.TintColor = FSlateColor(NormalButtonColor);
145 Border_BG->SetBrush(CachedBorderBrush);
146 }
147 else
148 {
149 Border_BG->SetBrushColor(NormalButtonColor);
150 }
151 }
152}

다음을 참조함 : bBorderBrushInitialized, bEnabled, Border_BG, BorderImage, CachedBorderBrush, NormalButtonColor, NormalTextColor, TargetBrightness, TargetScale, Text_Label.

다음에 의해서 참조됨 : HandleReleased(), NativeConstruct().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ NativeConstruct()

void UImageButton::NativeConstruct ( )
overrideprotectedvirtual

UImageButton.cpp 파일의 16 번째 라인에서 정의되었습니다.

17{
18 Super::NativeConstruct();
19
20 if (Button_Main)
21 {
22 // 중복 등록 방지를 위해 기존 바인딩 제거
23 Button_Main->OnHovered.RemoveDynamic(this, &UImageButton::HandleHovered);
24 Button_Main->OnUnhovered.RemoveDynamic(this, &UImageButton::HandleUnhovered);
25 Button_Main->OnPressed.RemoveDynamic(this, &UImageButton::HandlePressed);
26 Button_Main->OnReleased.RemoveDynamic(this, &UImageButton::HandleReleased);
27 Button_Main->OnClicked.RemoveDynamic(this, &UImageButton::HandleClicked);
28
29 Button_Main->OnHovered.AddDynamic(this, &UImageButton::HandleHovered);
30 Button_Main->OnUnhovered.AddDynamic(this, &UImageButton::HandleUnhovered);
31 Button_Main->OnPressed.AddDynamic(this, &UImageButton::HandlePressed);
32 Button_Main->OnReleased.AddDynamic(this, &UImageButton::HandleReleased);
33 Button_Main->OnClicked.AddDynamic(this, &UImageButton::HandleClicked);
34 }
35}
void HandleReleased()

다음을 참조함 : Button_Main, HandleClicked(), HandleHovered(), HandlePressed(), HandleReleased(), HandleUnhovered().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ NativePreConstruct()

void UImageButton::NativePreConstruct ( )
overrideprotectedvirtual

UImageButton.cpp 파일의 10 번째 라인에서 정의되었습니다.

11{
12 Super::NativePreConstruct();
13 ApplyStyle();
14}
void ApplyStyle()
설정된 스타일 속성을 위젯에 적용합니다.

다음을 참조함 : ApplyStyle().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ NativeTick()

void UImageButton::NativeTick ( const FGeometry &  MyGeometry,
float  InDeltaTime 
)
overrideprotectedvirtual

UImageButton.cpp 파일의 90 번째 라인에서 정의되었습니다.

91{
92 Super::NativeTick(MyGeometry, InDeltaTime);
93
94 // 스케일 보간
95 CurrentScale = FMath::Vector2DInterpTo(CurrentScale, TargetScale, InDeltaTime, LerpSpeed);
96 SetRenderScale(CurrentScale);
97}
FVector2D CurrentScale

다음을 참조함 : CurrentScale, LerpSpeed, TargetScale.

◆ SetButtonEnabled()

void UImageButton::SetButtonEnabled ( bool  bInEnabled)

버튼의 활성화/비활성화 상태를 설정합니다.

매개변수
bInEnabledtrue면 활성화, false면 비활성화

UImageButton.cpp 파일의 199 번째 라인에서 정의되었습니다.

200{
201 bEnabled = bInEnabled;
202
203 if (Button_Main)
204 {
205 Button_Main->SetIsEnabled(bInEnabled);
206 }
207
208 if (bInEnabled)
209 {
210 TargetScale = FVector2D(1.f, 1.f);
211 TargetBrightness = 1.f;
212
213 if (Border_BG)
214 {
216 {
217 CachedBorderBrush.TintColor = FSlateColor(NormalButtonColor);
218 Border_BG->SetBrush(CachedBorderBrush);
219 }
220 else
221 {
222 Border_BG->SetBrushColor(NormalButtonColor);
223 }
224 }
225
226 if (Text_Label)
227 {
228 Text_Label->SetColorAndOpacity(NormalTextColor);
229 }
230 }
231 else
232 {
233 TargetScale = FVector2D(1.f, 1.f);
234 TargetBrightness = 0.4f;
235
236 if (Border_BG)
237 {
239 {
240 CachedBorderBrush.TintColor = FSlateColor(NormalButtonColor * 0.5f);
241 Border_BG->SetBrush(CachedBorderBrush);
242 }
243 else
244 {
245 Border_BG->SetBrushColor(NormalButtonColor * 0.5f);
246 }
247 }
248
249 if (Text_Label)
250 {
251 Text_Label->SetColorAndOpacity(NormalTextColor * 0.5f);
252 }
253 }
254}

다음을 참조함 : bBorderBrushInitialized, bEnabled, Border_BG, BorderImage, Button_Main, CachedBorderBrush, NormalButtonColor, NormalTextColor, TargetBrightness, TargetScale, Text_Label.

멤버 데이터 문서화

◆ bBorderBrushInitialized

bool UImageButton::bBorderBrushInitialized = false
private

UImageButton.h 파일의 150 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleHovered(), HandlePressed(), HandleUnhovered(), SetButtonEnabled().

◆ bEnabled

bool UImageButton::bEnabled = true
private

UImageButton.h 파일의 146 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleClicked(), HandleHovered(), HandlePressed(), HandleReleased(), HandleUnhovered(), SetButtonEnabled().

◆ Border_BG

class UBorder* UImageButton::Border_BG
private

UImageButton.h 파일의 129 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleHovered(), HandlePressed(), HandleUnhovered(), SetButtonEnabled().

◆ BorderDrawAs

TEnumAsByte<ESlateBrushDrawType::Type> UImageButton::BorderDrawAs = ESlateBrushDrawType::Image

Border 이미지의 그리기 방식 (Image, Box, Border, RoundedBox 등)

UImageButton.h 파일의 101 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ BorderImage

UTexture2D* UImageButton::BorderImage = nullptr

Border에 적용할 이미지 (null이면 색상만 사용)

UImageButton.h 파일의 97 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleHovered(), HandlePressed(), HandleUnhovered(), SetButtonEnabled().

◆ BorderMargin

FMargin UImageButton::BorderMargin = FMargin(0.0f)

Border 이미지의 여백 (9-slice 방식으로 그릴 때 사용)

UImageButton.h 파일의 105 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ bUseFixedSize

bool UImageButton::bUseFixedSize = false

고정 크기 사용 여부

UImageButton.h 파일의 111 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ Button_Main

class UButton* UImageButton::Button_Main
private

UImageButton.h 파일의 126 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleReleased(), NativeConstruct(), SetButtonEnabled().

◆ CachedBorderBrush

FSlateBrush UImageButton::CachedBorderBrush
private

UImageButton.h 파일의 149 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleHovered(), HandlePressed(), HandleUnhovered(), SetButtonEnabled().

◆ CurrentBrightness

float UImageButton::CurrentBrightness = 1.0f
private

UImageButton.h 파일의 137 번째 라인에서 정의되었습니다.

◆ CurrentScale

FVector2D UImageButton::CurrentScale = FVector2D(1.f, 1.f)
private

UImageButton.h 파일의 136 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : NativeTick().

◆ FixedHeight

float UImageButton::FixedHeight = 100.0f

고정 높이 (bUseFixedSize가 true일 때 적용)

UImageButton.h 파일의 119 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ FixedWidth

float UImageButton::FixedWidth = 200.0f

고정 너비 (bUseFixedSize가 true일 때 적용)

UImageButton.h 파일의 115 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ FontOutlineSize

int32 UImageButton::FontOutlineSize = 0

UImageButton.h 파일의 71 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ FontSize

int32 UImageButton::FontSize = 48

UImageButton.h 파일의 68 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ HoverButtonColor

FLinearColor UImageButton::HoverButtonColor = FLinearColor(0.2f, 0.2f, 0.2f)

UImageButton.h 파일의 88 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleHovered().

◆ HoverTextColor

FLinearColor UImageButton::HoverTextColor = FLinearColor(0.8f, 0.9f, 1.f)

UImageButton.h 파일의 77 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleHovered().

◆ LabelText

FText UImageButton::LabelText = FText::FromString("Button")

UImageButton.h 파일의 65 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ LerpSpeed

float UImageButton::LerpSpeed = 20.f
private

UImageButton.h 파일의 144 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : NativeTick().

◆ NormalButtonColor

FLinearColor UImageButton::NormalButtonColor = FLinearColor(0.1f, 0.1f, 0.1f)

UImageButton.h 파일의 85 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleUnhovered(), SetButtonEnabled().

◆ NormalTextColor

FLinearColor UImageButton::NormalTextColor = FLinearColor::White

UImageButton.h 파일의 74 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleUnhovered(), SetButtonEnabled().

◆ OnButtonClickedEvent

FOnImageButtonClickedEvent UImageButton::OnButtonClickedEvent

버튼 클릭 시 발생하는 이벤트

UImageButton.h 파일의 60 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleClicked(), UPopup_MsgBox::InitButton(), UPopup_InputMsg::InitPopup(), UPopup_AskTutorial::NativeConstruct(), ULobbyWidget::NativeConstruct().

◆ PressButtonColor

FLinearColor UImageButton::PressButtonColor = FLinearColor(0.05f, 0.05f, 0.05f)

UImageButton.h 파일의 91 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandlePressed().

◆ PressTextColor

FLinearColor UImageButton::PressTextColor = FLinearColor(0.6f, 0.7f, 1.f)

UImageButton.h 파일의 80 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandlePressed().

◆ SizeBox_Root

class USizeBox* UImageButton::SizeBox_Root
private

UImageButton.h 파일의 123 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle().

◆ TargetBrightness

float UImageButton::TargetBrightness = 1.f
private

UImageButton.h 파일의 141 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleHovered(), HandleUnhovered(), SetButtonEnabled().

◆ TargetScale

FVector2D UImageButton::TargetScale = FVector2D(1.f, 1.f)
private

UImageButton.h 파일의 140 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : HandleHovered(), HandlePressed(), HandleUnhovered(), NativeTick(), SetButtonEnabled().

◆ Text_Label

class UTextBlock* UImageButton::Text_Label
private

UImageButton.h 파일의 132 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ApplyStyle(), HandleHovered(), HandlePressed(), HandleUnhovered(), SetButtonEnabled().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: