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

#include <ULevelWordItem.h>

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

Public 멤버 함수

void InitInfo (EWordType WordType, int32 WordCode)
 
void SetItemColor (bool bIsCurrentLevel)
 아이템의 색상을 설정 (현재 레벨: 녹색, 하위 레벨: 회색)
 

Public 속성

bool bUseScaleBox = false
 텍스트 처리 방식 (true: ScaleBox 사용, false: 단순 절삭)
 
TObjectPtr< class UImage > Image_Target
 
TObjectPtr< class UScaleBox > ScaleBox
 
TObjectPtr< class USizeBox > SizeBox
 
TObjectPtr< class UTextBlock > Txt_Title
 

Protected 멤버 함수

void ApplyScaleBoxMode ()
 ScaleBox를 사용한 텍스트 크기 자동 조절 (방법 1)
 
void ApplyTruncateMode (const FString &Text)
 텍스트 절삭 방식 적용 (방법 2)
 
FString TruncateText (const FString &OriginalText, int32 MaxLength=12)
 긴 텍스트를 축약하여 반환 (방법 2: 단순 절삭)
 

상세한 설명

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

멤버 함수 문서화

◆ ApplyScaleBoxMode()

void ULevelWordItem::ApplyScaleBoxMode ( )
protected

ScaleBox를 사용한 텍스트 크기 자동 조절 (방법 1)

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

100{
101 // 방법 1: ScaleBox를 사용한 자동 크기 조절
102 if (ScaleBox)
103 {
104 ScaleBox->SetStretch(EStretch::ScaleToFit);
105 }
106}
TObjectPtr< class UScaleBox > ScaleBox

다음을 참조함 : ScaleBox.

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

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

◆ ApplyTruncateMode()

void ULevelWordItem::ApplyTruncateMode ( const FString &  Text)
protected

텍스트 절삭 방식 적용 (방법 2)

매개변수
Text표시할 텍스트

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

109{
110 // 방법 2: 단순 절삭 방식
111 FString TruncatedText = TruncateText(Text);
112 Txt_Title->SetText(FText::FromString(TruncatedText));
113}
TObjectPtr< class UTextBlock > Txt_Title
FString TruncateText(const FString &OriginalText, int32 MaxLength=12)
긴 텍스트를 축약하여 반환 (방법 2: 단순 절삭)

다음을 참조함 : TruncateText(), Txt_Title.

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

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

◆ InitInfo()

void ULevelWordItem::InitInfo ( EWordType  WordType,
int32  WordCode 
)

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

12{
13 FString DisplayText;
14
15 if( WordType == EWordType::Animal )
16 {
17 FReadData ReadData;
18 UGameDataManager::Get(GetWorld())->GetReadData(WordCode, ReadData);
19
20 UTexture2D* LoadedTexture = nullptr;
21 if (ReadData.Texture.IsValid())
22 LoadedTexture = ReadData.Texture.Get();
23 else
24 LoadedTexture = ReadData.Texture.LoadSynchronous();
25
26 Image_Target->SetBrushFromTexture(LoadedTexture, true);
27 Image_Target->SetColorAndOpacity( FLinearColor::White );
28
29 DisplayText = ReadData.Eng;
30 }
31 else if( WordType == EWordType::Color )
32 {
33 FColorData ColorData;
34 UGameDataManager::Get(GetWorld())->GetColorData(WordCode, ColorData);
35
36 UTexture2D* ColorTexture = UGameDataManager::Get(this)->GetTexture(EResourceTextureType::Color);
37 Image_Target->SetBrushFromTexture(ColorTexture, true);
38 Image_Target->SetColorAndOpacity( ColorData.GetLinearColor());
39
40 DisplayText = ColorData.Eng;
41 }
42 else if( WordType == EWordType::Region )
43 {
44 FListenData ListenData;
45 UGameDataManager::Get(GetWorld())->GetListenData(WordCode, ListenData);
46
47 UTexture2D* LoadedTexture = nullptr;
48 if (ListenData.Texture.IsValid())
49 LoadedTexture = ListenData.Texture.Get();
50 else
51 LoadedTexture = ListenData.Texture.LoadSynchronous();
52
53 Image_Target->SetBrushFromTexture(LoadedTexture, true);
54 Image_Target->SetColorAndOpacity( FLinearColor::White );
55
56 DisplayText = ListenData.Eng;
57 }
58 else if( WordType == EWordType::Food )
59 {
60 FListenData ListenData;
61 UGameDataManager::Get(GetWorld())->GetListenData(WordCode, ListenData);
62
63 UTexture2D* LoadedTexture = nullptr;
64 if (ListenData.Texture.IsValid())
65 LoadedTexture = ListenData.Texture.Get();
66 else
67 LoadedTexture = ListenData.Texture.LoadSynchronous();
68
69 Image_Target->SetBrushFromTexture(LoadedTexture, true);
70 Image_Target->SetColorAndOpacity( FLinearColor::White );
71
72 DisplayText = ListenData.Eng;
73 }
74
75 // 텍스트 처리 방식 적용
76 if (bUseScaleBox)
77 {
78 // 방법 1: ScaleBox 사용 (자동 크기 조절)
80 Txt_Title->SetText(FText::FromString(DisplayText));
81 }
82 else
83 {
84 // 방법 2: 단순 절삭 방식
85 ApplyTruncateMode(DisplayText);
86 }
87}
bool bUseScaleBox
텍스트 처리 방식 (true: ScaleBox 사용, false: 단순 절삭)
void ApplyScaleBoxMode()
ScaleBox를 사용한 텍스트 크기 자동 조절 (방법 1)
TObjectPtr< class UImage > Image_Target
void ApplyTruncateMode(const FString &Text)
텍스트 절삭 방식 적용 (방법 2)
색상 데이터를 정의하는 구조체
Definition FColorData.h:19
FString Eng
Definition FColorData.h:39
FLinearColor GetLinearColor() const
HexColor 문자열을 FLinearColor로 변환하여 반환
Definition FColorData.h:43
듣기 학습 데이터를 정의하는 구조체
Definition FListenData.h:19
TSoftObjectPtr< UTexture2D > Texture
Definition FListenData.h:49
FString Eng
Definition FListenData.h:43
읽기 학습 데이터를 정의하는 구조체
Definition FReadData.h:19
FString Eng
학습 단어
Definition FReadData.h:39
TSoftObjectPtr< UTexture2D > Texture
Definition FReadData.h:35

다음을 참조함 : Animal, ApplyScaleBoxMode(), ApplyTruncateMode(), bUseScaleBox, Color, FColorData::Eng, FListenData::Eng, FReadData::Eng, Food, FColorData::GetLinearColor(), Image_Target, Region, FListenData::Texture, FReadData::Texture, Txt_Title.

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

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

◆ SetItemColor()

void ULevelWordItem::SetItemColor ( bool  bIsCurrentLevel)

아이템의 색상을 설정 (현재 레벨: 녹색, 하위 레벨: 회색)

매개변수
bIsCurrentLeveltrue면 녹색, false면 회색

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

90{
91 FLinearColor TargetColor = bIsCurrentLevel ? FLinearColor::Black : FLinearColor(0.5f, 0.5f, 0.5f, 1.0f);
92
93 if (Txt_Title)
94 {
95 Txt_Title->SetColorAndOpacity(TargetColor);
96 }
97}

다음을 참조함 : Txt_Title.

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

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

◆ TruncateText()

FString ULevelWordItem::TruncateText ( const FString &  OriginalText,
int32  MaxLength = 12 
)
protected

긴 텍스트를 축약하여 반환 (방법 2: 단순 절삭)

매개변수
OriginalText원본 텍스트
MaxLength최대 길이
반환값
축약된 텍스트

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

116{
117 if (OriginalText.Len() <= MaxLength)
118 {
119 return OriginalText;
120 }
121
122 // MaxLength를 넘어가면 그냥 잘라내고 "..." 추가
123 return OriginalText.Left(MaxLength - 3) + TEXT("...");
124}

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

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

멤버 데이터 문서화

◆ bUseScaleBox

bool ULevelWordItem::bUseScaleBox = false

텍스트 처리 방식 (true: ScaleBox 사용, false: 단순 절삭)

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

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

◆ Image_Target

TObjectPtr<class UImage> ULevelWordItem::Image_Target

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

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

◆ ScaleBox

TObjectPtr<class UScaleBox> ULevelWordItem::ScaleBox

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

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

◆ SizeBox

TObjectPtr<class USizeBox> ULevelWordItem::SizeBox

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

◆ Txt_Title

TObjectPtr<class UTextBlock> ULevelWordItem::Txt_Title

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

다음에 의해서 참조됨 : ApplyTruncateMode(), InitInfo(), SetItemColor().


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