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

레벨 선택 팝업 위젯 더 자세히 ...

#include <UPopup_LevelSelect.h>

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

Public 멤버 함수

void InitPopup ()
 팝업을 초기화하고 레벨 아이템들을 생성
 
virtual void NativeTick (const FGeometry &MyGeometry, float InDeltaTime) override
 
void OpenAnimation ()
 팝업 오픈 애니메이션을 재생합니다
 

Public 속성

bool bAllowPlayerControl = false
 이 팝업이 활성화되어 있을 때 플레이어 조작을 허용할지 여부
 
FOnPopupClosedDelegate OnPopupClosed
 팝업이 닫힐 때 호출되는 델리게이트
 

Protected 멤버 함수

virtual void NativeConstruct () override
 
void OnClickClose ()
 
void OnLevelSelected (int32 SelectedLevel)
 레벨 선택 이벤트 핸들러
 
void UpdateAnimation (float InDeltaTime)
 스크립트 오픈 애니메이션 업데이트
 

Protected 속성

bool bIsOpenAnim = false
 애니메이션 재생 중 여부
 
UWidgetAnimation * BlueprintOpenAnimation
 블루프린트에서 정의한 오픈 애니메이션
 
TObjectPtr< class UTextureButtonBtn_Close
 팝업 닫기 버튼 (우측 상단)
 
TObjectPtr< class UHorizontalBox > HorizontalBox
 레벨 아이템들이 배치될 Horizontal Box
 
TArray< FString > LevelNames = {TEXT("Begginer"), TEXT("Intermediate"), TEXT("Advanced")}
 레벨 이름 배열
 
TSubclassOf< class ULevelSelectItemLevelSelectItemClass
 생성할 LevelSelectItem 위젯 클래스
 
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
 
int32 TotalLevels = 3
 전체 레벨 개수
 

상세한 설명

레벨 선택 팝업 위젯

여러 난이도 레벨을 선택할 수 있는 팝업. 3개의 레벨 아이템을 표시하고 좌우 버튼으로 페이지 이동

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

멤버 함수 문서화

◆ InitPopup()

void UPopup_LevelSelect::InitPopup ( )

팝업을 초기화하고 레벨 아이템들을 생성

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

19{
20 if (Btn_Close)
21 {
22 Btn_Close->OnButtonClickedEvent.RemoveDynamic(this, &UPopup_LevelSelect::OnClickClose);
23 Btn_Close->OnButtonClickedEvent.AddDynamic(this, &UPopup_LevelSelect::OnClickClose);
24 }
25
26 // 기존 아이템들 제거
27 HorizontalBox->ClearChildren();
28
29 // 레벨 아이템들 생성 및 추가
30 for (int32 i = 0; i < LevelNames.Num(); ++i)
31 {
32 ULevelSelectItem* LevelItem = CreateWidget<ULevelSelectItem>(this, LevelSelectItemClass);
33 if (LevelItem)
34 {
35 // 레벨은 1부터 시작 (i+1)
36 int32 Level = i + 1;
37 FString LevelName = (i < LevelNames.Num()) ? LevelNames[i] : FString::Printf(TEXT("Level %d"), Level);
38
39 LevelItem->InitLevelItem(Level, LevelName, 3);
40
41 // 델리게이트 바인딩
42 LevelItem->OnLevelSelected.BindUObject(this, &UPopup_LevelSelect::OnLevelSelected);
43
44 HorizontalBox->AddChildToHorizontalBox(LevelItem);
45 }
46
47 // 마지막 항목이 아니면 Spacer 추가
48 if (i < LevelNames.Num() - 1)
49 {
50 USpacer* Spacer = NewObject<USpacer>(this);
51 if (Spacer)
52 {
53 Spacer->SetSize(FVector2D(45.0f, 0));
54 HorizontalBox->AddChildToHorizontalBox(Spacer);
55 }
56 }
57 }
58}
레벨 선택 아이템 위젯
void InitLevelItem(int32 InLevel, const FString &InLevelName, int32 InPlayTime)
레벨 정보를 초기화하고 단어 그룹들을 생성
FOnLevelSelectedDelegate OnLevelSelected
레벨 선택 델리게이트
void OnLevelSelected(int32 SelectedLevel)
레벨 선택 이벤트 핸들러
TObjectPtr< class UTextureButton > Btn_Close
팝업 닫기 버튼 (우측 상단)
TObjectPtr< class UHorizontalBox > HorizontalBox
레벨 아이템들이 배치될 Horizontal Box
TArray< FString > LevelNames
레벨 이름 배열
TSubclassOf< class ULevelSelectItem > LevelSelectItemClass
생성할 LevelSelectItem 위젯 클래스

다음을 참조함 : Btn_Close, HorizontalBox, ULevelSelectItem::InitLevelItem(), LevelNames, LevelSelectItemClass, OnClickClose(), ULevelSelectItem::OnLevelSelected, OnLevelSelected().

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

◆ NativeConstruct()

void UPopup_LevelSelect::NativeConstruct ( )
overrideprotectedvirtual

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

14{
15 Super::NativeConstruct();
16}

◆ 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().

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

◆ OnClickClose()

void UPopup_LevelSelect::OnClickClose ( )
protected

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

76{
77 // 팝업 닫힘 델리게이트 실행
78 if (OnPopupClosed.IsBound())
79 OnPopupClosed.Execute();
80
81 // PopupManager를 통해 팝업 닫기
82 if (UPopupManager* PopupMgr = UPopupManager::Get(GetWorld()))
83 {
84 PopupMgr->HideCurrentPopup();
85 }
86}
팝업 관리자
FOnPopupClosedDelegate OnPopupClosed
팝업이 닫힐 때 호출되는 델리게이트

다음을 참조함 : OnPopupClosed.

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

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

◆ OnLevelSelected()

void UPopup_LevelSelect::OnLevelSelected ( int32  SelectedLevel)
protected

레벨 선택 이벤트 핸들러

매개변수
SelectedLevel선택된 레벨

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

61{
62 // GameState의 RoomLevel 설정 (Host만 팝업을 열므로 Host에서만 실행됨)
63 if (ALingoGameState* GameState = GetWorld()->GetGameState<ALingoGameState>())
64 {
65 GameState->SetRoomLevel(SelectedLevel);
66 }
67 else
68 {
69 PRINTLOG(TEXT("Failed to get ALingoGameState"));
70 }
71
73}
#define PRINTLOG(fmt,...)
Definition GameLogging.h:30

다음을 참조함 : OnClickClose(), PRINTLOG.

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

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

◆ 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().

◆ Btn_Close

TObjectPtr<class UTextureButton> UPopup_LevelSelect::Btn_Close
protected

팝업 닫기 버튼 (우측 상단)

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

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

◆ HorizontalBox

TObjectPtr<class UHorizontalBox> UPopup_LevelSelect::HorizontalBox
protected

레벨 아이템들이 배치될 Horizontal Box

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

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

◆ LevelNames

TArray<FString> UPopup_LevelSelect::LevelNames = {TEXT("Begginer"), TEXT("Intermediate"), TEXT("Advanced")}
protected

레벨 이름 배열

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

64{TEXT("Begginer"), TEXT("Intermediate"), TEXT("Advanced")};

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

◆ LevelSelectItemClass

TSubclassOf<class ULevelSelectItem> UPopup_LevelSelect::LevelSelectItemClass
protected

생성할 LevelSelectItem 위젯 클래스

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

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

◆ OnPopupClosed

FOnPopupClosedDelegate UPopup_LevelSelect::OnPopupClosed

팝업이 닫힐 때 호출되는 델리게이트

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

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

◆ 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().

◆ TotalLevels

int32 UPopup_LevelSelect::TotalLevels = 3
protected

전체 레벨 개수

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


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