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

#include <Popup_QuestionnaireResultItem.h>

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

Public 멤버 함수

void InitItem (int32 index, FString questionKor, const FResponseWriteData &data)
 질문 항목 초기화
 
virtual void NativeTick (const FGeometry &MyGeometry, float InDeltaTime) override
 
void OpenAnimation ()
 팝업 오픈 애니메이션을 재생합니다
 

Public 속성

bool bAllowPlayerControl = false
 이 팝업이 활성화되어 있을 때 플레이어 조작을 허용할지 여부
 

Protected 멤버 함수

void UpdateAnimation (float InDeltaTime)
 스크립트 오픈 애니메이션 업데이트
 

Protected 속성

bool bIsOpenAnim = false
 애니메이션 재생 중 여부
 
UWidgetAnimation * BlueprintOpenAnimation
 블루프린트에서 정의한 오픈 애니메이션
 
TObjectPtr< class UImage > Image_Answer
 플레이어가 작성한 답안 이미지
 
EGameSoundType OpenAnimSound = EGameSoundType::UI_PopupOpen
 팝업 오픈 시 재생될 사운드 타입
 
float OpenDuration = 0.2f
 애니메이션 지속 시간
 
EEaseType OpenEaseType = EEaseType::EaseOutBack
 Easing 타입
 
float OpenElapsedTime = 0.0f
 경과 시간
 
FVector2D OpenPivot = FVector2D(0.5f, 0.5f)
 애니메이션 중심점 (0~1 범위)
 
float OpenStartScale = 0.8f
 시작 스케일
 
float OpenTargetScale = 1.0f
 목표 스케일
 
EPopupType PopupType
 
TObjectPtr< class USizeBox > SizeBox_Answer
 
TObjectPtr< class UTextBlock > Text_Feedback
 "What is your current country..." 같은 질문 내용
 
TObjectPtr< class UTextBlock > Text_Index
 "Question.01" 같은 질문 인덱스
 
TObjectPtr< class UTextBlock > Text_Question
 

Private 멤버 함수

UTexture2D * LoadTextureFromFile (const FString &filePath)
 

Private 속성

FResponseWriteData QuestionData
 
FString WriteImagePath = FPaths::ProjectSavedDir() / TEXT("WriteImage/")
 

상세한 설명

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

멤버 함수 문서화

◆ InitItem()

void UPopup_QuestionnaireResultItem::InitItem ( int32  index,
FString  questionKor,
const FResponseWriteData data 
)

질문 항목 초기화

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

15{
16 // 질문 인덱스 설정 (예: "Question.01")
17 if (Text_Index)
18 {
19 FString IndexText = FString::Printf(TEXT("Q%d"), index);
20 Text_Index->SetText(FText::FromString(IndexText));
21 }
22
23 if (Text_Question)
24 {
25 PRINTLOG(TEXT("Question: %s"), *questionKor);
26 Text_Question->SetText(FText::FromString(questionKor));
27 }
28
29 // 이미지 불러와서 적용
30 FString FileName = FString::Printf(TEXT("Answer%d.PNG"), index);
31 UTexture2D* LoadedTexture = LoadTextureFromFile(WriteImagePath / FileName);
32
33 if (LoadedTexture)
34 {
35 // SizeBox 비율 이미지에 맞게 수정
36 const float MaxWidthLimit = 1080.0f;
37 const float TargetHeight = 360.0f;
38
39 const float TextureWidth = static_cast<float>(LoadedTexture->GetSizeX());
40 const float TextureHeight = static_cast<float>(LoadedTexture->GetSizeY());
41 const float AspectRatio = TextureWidth / TextureHeight;
42
43 // 1. 이미지 위젯의 브러시 정보를 가져와서 텍스처와 사이즈를 일치시킴
44 // 이 작업이 빠지면 이미지는 이전 브러시 사이즈(360x360)에 텍스처를 맞춥니다.
45 FSlateBrush NewBrush = Image_Answer->GetBrush();
46 NewBrush.SetResourceObject(LoadedTexture);
47 NewBrush.ImageSize = FVector2D(TextureWidth, TextureHeight); // 브러시 자체 크기를 원본으로 설정
48 Image_Answer->SetBrush(NewBrush);
49
50 float NewWidth = TargetHeight * AspectRatio;
51 float NewHeight = TargetHeight;
52
53 // 가로 제한을 넘을 경우 비율 유지하며 축소
54 if (NewWidth > MaxWidthLimit)
55 {
56 NewWidth = MaxWidthLimit;
57 NewHeight = NewWidth / AspectRatio;
58 }
59
60 // 3. SizeBox의 가로/세로를 모두 명시적으로 고정
61 SizeBox_Answer->SetWidthOverride(NewWidth);
62 SizeBox_Answer->SetHeightOverride(NewHeight);
63
64 Image_Answer->SetBrushFromTexture(LoadedTexture);
65 }
66
67 // 피드백 내용 설정
68 FString Description = FString::Printf(TEXT("%s\n\n[Correction]\n%s"),
69 *data.display.message,
70 *data.display.correction);
71
72 Text_Feedback->SetText(FText::FromString(Description));
73 Text_Feedback->SetLineHeightPercentage( DefineData::LineHeightPercentage );
74}
#define PRINTLOG(fmt,...)
Definition GameLogging.h:30
TObjectPtr< class UTextBlock > Text_Feedback
"What is your current country..." 같은 질문 내용
TObjectPtr< class UImage > Image_Answer
플레이어가 작성한 답안 이미지
TObjectPtr< class USizeBox > SizeBox_Answer
UTexture2D * LoadTextureFromFile(const FString &filePath)
TObjectPtr< class UTextBlock > Text_Question
TObjectPtr< class UTextBlock > Text_Index
"Question.01" 같은 질문 인덱스
static const float LineHeightPercentage
Definition Onepiece.h:63
FWriteDisplay display
FString correction
FString message

다음을 참조함 : FWriteDisplay::correction, FResponseWriteData::display, Image_Answer, DefineData::LineHeightPercentage, LoadTextureFromFile(), FWriteDisplay::message, PRINTLOG, SizeBox_Answer, Text_Feedback, Text_Index, Text_Question, WriteImagePath.

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

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

◆ LoadTextureFromFile()

UTexture2D * UPopup_QuestionnaireResultItem::LoadTextureFromFile ( const FString &  filePath)
private

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

77{
78 TArray<uint8> RawFileData;
79 if (!FFileHelper::LoadFileToArray(RawFileData, *filePath))
80 {
81 PRINTLOG(TEXT("Failed to load file: %s"), *filePath);
82 return nullptr;
83 }
84
85 IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
86 TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);
87
88 if (!ImageWrapper.IsValid() || !ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
89 {
90 PRINTLOG(TEXT("Failed to parse PNG: %s"), *filePath);
91 return nullptr;
92 }
93
94 TArray<uint8> UncompressedBGRA;
95 if (!ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
96 {
97 PRINTLOG(TEXT("Failed to decompress PNG: %s"), *filePath);
98 return nullptr;
99 }
100
101 UTexture2D* Texture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
102 if (!Texture)
103 {
104 return nullptr;
105 }
106
107 void* TextureData = Texture->GetPlatformData()->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
108 FMemory::Memcpy(TextureData, UncompressedBGRA.GetData(), UncompressedBGRA.Num());
109 Texture->GetPlatformData()->Mips[0].BulkData.Unlock();
110 Texture->UpdateResource();
111
112 return Texture;
113}

다음을 참조함 : PRINTLOG.

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

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

◆ NativeTick()

void UBasePopup::NativeTick ( const FGeometry &  MyGeometry,
float  InDeltaTime 
)
overridevirtualinherited

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

8{
9 Super::NativeTick(MyGeometry, InDeltaTime);
10
11 if (bIsOpenAnim)
12 {
13 UpdateAnimation(InDeltaTime);
14 }
15}
bool bIsOpenAnim
애니메이션 재생 중 여부
Definition UBasePopup.h:57
void UpdateAnimation(float InDeltaTime)
스크립트 오픈 애니메이션 업데이트

다음을 참조함 : UBasePopup::bIsOpenAnim, UBasePopup::UpdateAnimation().

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

◆ OpenAnimation()

void UBasePopup::OpenAnimation ( )
inherited

팝업 오픈 애니메이션을 재생합니다

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

18{
19 if (!IsInViewport())
20 {
21 AddToViewport();
22 }
23
24 // 팝업 오픈 사운드 재생 (None이 아닐 때만)
26 {
27 if (UGameSoundManager* SoundManager = UGameSoundManager::Get(this))
28 {
29 SoundManager->PlaySound2D(OpenAnimSound);
30 }
31 }
32
33 // 블루프린트에서 정의한 애니메이션이 있으면 해당 애니메이션 재생
35 {
36 PlayAnimation(BlueprintOpenAnimation);
37 return;
38 }
39
40 // 블루프린트 애니메이션이 없으면 기본 스크립트 애니메이션 사용
41 SetRenderTransformPivot(OpenPivot);
42 SetRenderScale(FVector2D(OpenStartScale, OpenStartScale));
43
44 bIsOpenAnim = OpenDuration > KINDA_SMALL_NUMBER;
45 OpenElapsedTime = 0.0f;
46
47 if (!bIsOpenAnim)
48 {
49 SetRenderScale(FVector2D(OpenTargetScale, OpenTargetScale));
50 }
51}
EGameSoundType OpenAnimSound
팝업 오픈 시 재생될 사운드 타입
Definition UBasePopup.h:96
float OpenDuration
애니메이션 지속 시간
Definition UBasePopup.h:64
float OpenElapsedTime
경과 시간
Definition UBasePopup.h:60
float OpenStartScale
시작 스케일
Definition UBasePopup.h:68
FVector2D OpenPivot
애니메이션 중심점 (0~1 범위)
Definition UBasePopup.h:76
float OpenTargetScale
목표 스케일
Definition UBasePopup.h:72
UWidgetAnimation * BlueprintOpenAnimation
블루프린트에서 정의한 오픈 애니메이션
Definition UBasePopup.h:45
게임 내 모든 사운드 재생을 관리하는 중앙 사운드 관리 서브시스템입니다.

다음을 참조함 : UBasePopup::bIsOpenAnim, UBasePopup::BlueprintOpenAnimation, None, UBasePopup::OpenAnimSound, UBasePopup::OpenDuration, UBasePopup::OpenElapsedTime, UBasePopup::OpenPivot, UBasePopup::OpenStartScale, UBasePopup::OpenTargetScale.

◆ UpdateAnimation()

void UBasePopup::UpdateAnimation ( float  InDeltaTime)
protectedinherited

스크립트 오픈 애니메이션 업데이트

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

54{
55 if (!bIsOpenAnim)
56 {
57 return;
58 }
59
60 OpenElapsedTime += InDeltaTime;
61
62 const float Alpha = FMath::Clamp(OpenElapsedTime / OpenDuration, 0.0f, 1.0f);
63 const float EasedAlpha = FEaseHelper::Ease(Alpha, OpenEaseType);
64 const float NewScale = FMath::Lerp(OpenStartScale, OpenTargetScale, EasedAlpha);
65
66 SetRenderScale(FVector2D(NewScale, NewScale));
67
68 if (Alpha >= 1.0f)
69 {
70 bIsOpenAnim = false;
71 }
72}
EEaseType OpenEaseType
Easing 타입
Definition UBasePopup.h:83
static float Ease(float Alpha, EEaseType Type)
Definition FEaseHelper.h:45

다음을 참조함 : UBasePopup::bIsOpenAnim, FEaseHelper::Ease(), UBasePopup::OpenDuration, UBasePopup::OpenEaseType, UBasePopup::OpenElapsedTime, UBasePopup::OpenStartScale, UBasePopup::OpenTargetScale.

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

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

멤버 데이터 문서화

◆ bAllowPlayerControl

bool UBasePopup::bAllowPlayerControl = false
inherited

이 팝업이 활성화되어 있을 때 플레이어 조작을 허용할지 여부

true면 이 팝업이 열려있어도 플레이어가 캐릭터를 조작할 수 있습니다. 기본값은 false (대부분의 팝업은 플레이어 조작을 차단)

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

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

◆ bIsOpenAnim

bool UBasePopup::bIsOpenAnim = false
protectedinherited

애니메이션 재생 중 여부

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

다음에 의해서 참조됨 : UBasePopup::NativeTick(), UBasePopup::OpenAnimation(), UBasePopup::UpdateAnimation().

◆ BlueprintOpenAnimation

UWidgetAnimation* UBasePopup::BlueprintOpenAnimation
protectedinherited

블루프린트에서 정의한 오픈 애니메이션

설정된 경우 스크립트 애니메이션 대신 이 애니메이션을 재생합니다.

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

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

◆ Image_Answer

TObjectPtr<class UImage> UPopup_QuestionnaireResultItem::Image_Answer
protected

플레이어가 작성한 답안 이미지

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

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

◆ OpenAnimSound

EGameSoundType UBasePopup::OpenAnimSound = EGameSoundType::UI_PopupOpen
protectedinherited

팝업 오픈 시 재생될 사운드 타입

블루프린트에서 팝업별로 다른 사운드를 설정할 수 있습니다. None으로 설정하면 사운드를 재생하지 않습니다. 기본값은 UI_PopupOpen입니다.

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

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

◆ OpenDuration

float UBasePopup::OpenDuration = 0.2f
protectedinherited

애니메이션 지속 시간

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

다음에 의해서 참조됨 : UBasePopup::OpenAnimation(), UBasePopup::UpdateAnimation().

◆ OpenEaseType

EEaseType UBasePopup::OpenEaseType = EEaseType::EaseOutBack
protectedinherited

Easing 타입

애니메이션의 보간 곡선을 선택합니다. 기본값은 EaseOutBack (탄성 효과)

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

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

◆ OpenElapsedTime

float UBasePopup::OpenElapsedTime = 0.0f
protectedinherited

경과 시간

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

다음에 의해서 참조됨 : UBasePopup::OpenAnimation(), UBasePopup::UpdateAnimation().

◆ OpenPivot

FVector2D UBasePopup::OpenPivot = FVector2D(0.5f, 0.5f)
protectedinherited

애니메이션 중심점 (0~1 범위)

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

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

◆ OpenStartScale

float UBasePopup::OpenStartScale = 0.8f
protectedinherited

시작 스케일

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

다음에 의해서 참조됨 : UBasePopup::OpenAnimation(), UBasePopup::UpdateAnimation().

◆ OpenTargetScale

float UBasePopup::OpenTargetScale = 1.0f
protectedinherited

목표 스케일

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

다음에 의해서 참조됨 : UBasePopup::OpenAnimation(), UBasePopup::UpdateAnimation().

◆ PopupType

EPopupType UBasePopup::PopupType
protectedinherited

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

다음에 의해서 참조됨 : UPopup_InputMsg::InitPopup(), UPopup_InputMsg::OnClickOk().

◆ QuestionData

FResponseWriteData UPopup_QuestionnaireResultItem::QuestionData
private

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

◆ SizeBox_Answer

TObjectPtr<class USizeBox> UPopup_QuestionnaireResultItem::SizeBox_Answer
protected

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

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

◆ Text_Feedback

TObjectPtr<class UTextBlock> UPopup_QuestionnaireResultItem::Text_Feedback
protected

"What is your current country..." 같은 질문 내용

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

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

◆ Text_Index

TObjectPtr<class UTextBlock> UPopup_QuestionnaireResultItem::Text_Index
protected

"Question.01" 같은 질문 인덱스

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

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

◆ Text_Question

TObjectPtr<class UTextBlock> UPopup_QuestionnaireResultItem::Text_Question
protected

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

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

◆ WriteImagePath

FString UPopup_QuestionnaireResultItem::WriteImagePath = FPaths::ProjectSavedDir() / TEXT("WriteImage/")
private

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

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


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