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

심플한 텍스쳐 기반 버튼 위젯 더 자세히 ...

#include <UTextureButton.h>

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

Public 멤버 함수

void SetButtonEnabled (bool bInEnabled)
 버튼 활성화 상태 설정
 
void SetButtonSize (float InWidth, float InHeight)
 버튼 크기 설정
 
void SetButtonTexture (UTexture2D *InTexture)
 버튼 배경 텍스쳐 설정
 
void SetSymbolTexture (UTexture2D *InTexture)
 심볼 이미지 텍스쳐 설정
 

Public 속성

float ButtonHeight = 100.0f
 버튼 높이
 
UTexture2D * ButtonTexture = nullptr
 버튼 배경 텍스쳐
 
float ButtonWidth = 100.0f
 버튼 너비
 
FLinearColor DisabledSymbolColor = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f)
 Disabled 상태 심볼 색상
 
FLinearColor HoverSymbolColor = FLinearColor(1.2f, 1.2f, 1.2f, 1.0f)
 Hover 상태 심볼 색상
 
FLinearColor NormalSymbolColor = FLinearColor::White
 Normal 상태 심볼 색상
 
FOnTextureButtonClickedEvent OnButtonClickedEvent
 버튼 클릭 이벤트
 
FLinearColor PressSymbolColor = FLinearColor(0.8f, 0.8f, 0.8f, 1.0f)
 Press 상태 심볼 색상
 
UTexture2D * SymbolTexture = nullptr
 심볼 이미지 텍스쳐
 

Protected 멤버 함수

virtual void NativeConstruct () override
 
virtual void NativePreConstruct () override
 

Private 멤버 함수

void ApplySymbolColor (const FLinearColor &Color)
 
void ApplyTextures ()
 
void HandleClicked ()
 
void HandleHovered ()
 
void HandlePressed ()
 
void HandleReleased ()
 
void HandleUnhovered ()
 

Private 속성

bool bEnabled = true
 
class UButton * Button_Main
 
class UImage * Image_Symbol
 

상세한 설명

심플한 텍스쳐 기반 버튼 위젯

Button이 배경 텍스쳐를 가지고, 그 안에 Image가 심볼로 표시됩니다.

  • Button: 배경 이미지 (ButtonTexture) + 크기 조정
  • Image_Symbol: 버튼 내부의 아이콘/심볼 (SymbolTexture)

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

멤버 함수 문서화

◆ ApplySymbolColor()

void UTextureButton::ApplySymbolColor ( const FLinearColor &  Color)
private

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

127{
128 if (Image_Symbol)
129 {
130 Image_Symbol->SetColorAndOpacity(Color);
131 }
132}
class UImage * Image_Symbol

다음을 참조함 : Color, Image_Symbol.

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

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

◆ ApplyTextures()

void UTextureButton::ApplyTextures ( )
private

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

39{
40 // 버튼 배경 텍스쳐 설정
42 {
43 FSlateBrush Brush;
44 Brush.SetResourceObject(ButtonTexture);
45
46 FButtonStyle Style = Button_Main->GetStyle();
47 Style.Normal = Brush;
48 Style.Hovered = Brush;
49 Style.Pressed = Brush;
50 Button_Main->SetStyle(Style);
51 }
52
53 // 심볼 이미지 텍스쳐 설정
55 {
56 Image_Symbol->SetBrushFromTexture(SymbolTexture);
58 }
59
60 // 버튼 크기 설정
62}
class UButton * Button_Main
void ApplySymbolColor(const FLinearColor &Color)
float ButtonHeight
버튼 높이
FLinearColor NormalSymbolColor
Normal 상태 심볼 색상
void SetButtonSize(float InWidth, float InHeight)
버튼 크기 설정
UTexture2D * SymbolTexture
심볼 이미지 텍스쳐
UTexture2D * ButtonTexture
버튼 배경 텍스쳐
float ButtonWidth
버튼 너비

다음을 참조함 : ApplySymbolColor(), Button_Main, ButtonHeight, ButtonTexture, ButtonWidth, Image_Symbol, NormalSymbolColor, SetButtonSize(), SymbolTexture.

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

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

◆ HandleClicked()

void UTextureButton::HandleClicked ( )
private

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

135{
136 if (!bEnabled)
137 return;
138
139 OnButtonClickedEvent.Broadcast();
140}
FOnTextureButtonClickedEvent OnButtonClickedEvent
버튼 클릭 이벤트

다음을 참조함 : bEnabled, OnButtonClickedEvent.

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

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

◆ HandleHovered()

void UTextureButton::HandleHovered ( )
private

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

143{
144 if (!bEnabled)
145 return;
146
148}
FLinearColor HoverSymbolColor
Hover 상태 심볼 색상

다음을 참조함 : ApplySymbolColor(), bEnabled, HoverSymbolColor.

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

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

◆ HandlePressed()

void UTextureButton::HandlePressed ( )
private

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

159{
160 if (!bEnabled)
161 return;
162
164}
FLinearColor PressSymbolColor
Press 상태 심볼 색상

다음을 참조함 : ApplySymbolColor(), bEnabled, PressSymbolColor.

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

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

◆ HandleReleased()

void UTextureButton::HandleReleased ( )
private

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

167{
168 if (!bEnabled)
169 return;
170
171 // Released 후 마우스가 여전히 버튼 위에 있는지 확인
172 if (Button_Main->IsHovered())
173 {
175 }
176 else
177 {
179 }
180}

다음을 참조함 : ApplySymbolColor(), bEnabled, Button_Main, HoverSymbolColor, NormalSymbolColor.

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

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

◆ HandleUnhovered()

void UTextureButton::HandleUnhovered ( )
private

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

151{
152 if (!bEnabled)
153 return;
154
156}

다음을 참조함 : ApplySymbolColor(), bEnabled, NormalSymbolColor.

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

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

◆ NativeConstruct()

void UTextureButton::NativeConstruct ( )
overrideprotectedvirtual

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

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

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

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

◆ NativePreConstruct()

void UTextureButton::NativePreConstruct ( )
overrideprotectedvirtual

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

9{
10 Super::NativePreConstruct();
12}

다음을 참조함 : ApplyTextures().

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

◆ SetButtonEnabled()

void UTextureButton::SetButtonEnabled ( bool  bInEnabled)

버튼 활성화 상태 설정

매개변수
bInEnabled활성화 여부

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

107{
108 bEnabled = bInEnabled;
109
110 if (Button_Main)
111 {
112 Button_Main->SetIsEnabled(bInEnabled);
113 }
114
115 // Disabled 상태 색상 적용
116 if (!bEnabled)
117 {
119 }
120 else
121 {
123 }
124}
FLinearColor DisabledSymbolColor
Disabled 상태 심볼 색상

다음을 참조함 : ApplySymbolColor(), bEnabled, Button_Main, DisabledSymbolColor, NormalSymbolColor.

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

◆ SetButtonSize()

void UTextureButton::SetButtonSize ( float  InWidth,
float  InHeight 
)

버튼 크기 설정

매개변수
InWidth버튼 너비
InHeight버튼 높이

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

92{
93 ButtonWidth = InWidth;
94 ButtonHeight = InHeight;
95
96 if (Button_Main)
97 {
98 // Button을 SizeBox로 감싸서 크기 조정
99 // 또는 RenderTransform 사용
100 // UMG 구조에 따라 SizeBox가 있다면 해당 SizeBox의 크기를 설정
101 // 여기서는 SetRenderTransformPivot와 SetRenderScale을 사용하지 않고
102 // 위젯 블루프린트에서 SizeBox를 사용하는 것을 권장
103 }
104}

다음을 참조함 : Button_Main, ButtonHeight, ButtonWidth.

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

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

◆ SetButtonTexture()

void UTextureButton::SetButtonTexture ( UTexture2D *  InTexture)

버튼 배경 텍스쳐 설정

매개변수
InTexture설정할 배경 텍스쳐

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

65{
66 ButtonTexture = InTexture;
67
69 {
70 FSlateBrush Brush;
71 Brush.SetResourceObject(ButtonTexture);
72
73 FButtonStyle Style = Button_Main->GetStyle();
74 Style.Normal = Brush;
75 Style.Hovered = Brush;
76 Style.Pressed = Brush;
77 Button_Main->SetStyle(Style);
78 }
79}

다음을 참조함 : Button_Main, ButtonTexture.

◆ SetSymbolTexture()

void UTextureButton::SetSymbolTexture ( UTexture2D *  InTexture)

심볼 이미지 텍스쳐 설정

매개변수
InTexture설정할 심볼 텍스쳐

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

82{
83 SymbolTexture = InTexture;
84
86 {
87 Image_Symbol->SetBrushFromTexture(SymbolTexture);
88 }
89}

다음을 참조함 : Image_Symbol, SymbolTexture.

멤버 데이터 문서화

◆ bEnabled

bool UTextureButton::bEnabled = true
private

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

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

◆ Button_Main

class UButton* UTextureButton::Button_Main
private

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

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

◆ ButtonHeight

float UTextureButton::ButtonHeight = 100.0f

버튼 높이

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

다음에 의해서 참조됨 : ApplyTextures(), SetButtonSize().

◆ ButtonTexture

UTexture2D* UTextureButton::ButtonTexture = nullptr

버튼 배경 텍스쳐

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

다음에 의해서 참조됨 : ApplyTextures(), SetButtonTexture().

◆ ButtonWidth

float UTextureButton::ButtonWidth = 100.0f

버튼 너비

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

다음에 의해서 참조됨 : ApplyTextures(), SetButtonSize().

◆ DisabledSymbolColor

FLinearColor UTextureButton::DisabledSymbolColor = FLinearColor(0.5f, 0.5f, 0.5f, 1.0f)

Disabled 상태 심볼 색상

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

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

◆ HoverSymbolColor

FLinearColor UTextureButton::HoverSymbolColor = FLinearColor(1.2f, 1.2f, 1.2f, 1.0f)

Hover 상태 심볼 색상

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

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

◆ Image_Symbol

class UImage* UTextureButton::Image_Symbol
private

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

다음에 의해서 참조됨 : ApplySymbolColor(), ApplyTextures(), SetSymbolTexture().

◆ NormalSymbolColor

FLinearColor UTextureButton::NormalSymbolColor = FLinearColor::White

Normal 상태 심볼 색상

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

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

◆ OnButtonClickedEvent

FOnTextureButtonClickedEvent UTextureButton::OnButtonClickedEvent

버튼 클릭 이벤트

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

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

◆ PressSymbolColor

FLinearColor UTextureButton::PressSymbolColor = FLinearColor(0.8f, 0.8f, 0.8f, 1.0f)

Press 상태 심볼 색상

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

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

◆ SymbolTexture

UTexture2D* UTextureButton::SymbolTexture = nullptr

심볼 이미지 텍스쳐

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

다음에 의해서 참조됨 : ApplyTextures(), SetSymbolTexture().


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