[UE 5.3.2] User Interface (Slate, UMG, HUD)

김민정·2024년 6월 4일

UnrealEngine

목록 보기
3/10
post-thumbnail

Unreal Engine 5.3.2 문서로 User Interface (Slate, UMG, HUD)를 공부한 내용입니다.

참고 자료

유저 인터페이스 및 HUD

https://dev.epicgames.com/documentation/ko-kr/unreal-engine/user-interfaces-and-huds-in-unreal-engine?application_version=5.4

Slate

https://dev.epicgames.com/documentation/ko-kr/unreal-engine/slate-overview-for-unreal-engine

Slate Architecture

https://dev.epicgames.com/documentation/ko-kr/unreal-engine/understanding-the-slate-ui-architecture-in-unreal-engine

UMG

https://dev.epicgames.com/documentation/ko-kr/unreal-engine/umg-editor-reference-for-unreal-engine

Forum (UMG vs Slate vs Canvas)

https://forums.unrealengine.com/t/umg-vs-slate-vs-canvas/110150/3

SWidget vs UWidget

https://velog.io/@sinsin63/SWidget-UWidget


HUD (Heads-up Displays)

  • 상호작용이 불가능한 UI
  • 게임 플레이 도중 화면에 오버레이되는 상태와 정보 (ex. 점수, 체력 등)
  • 멀티 플레이 환경에서 각 HUD는 자신의 뷰포트에만 표시된다.

Canvas

  • HUD의 렌더 루프 도중, 엘리먼트를 화면에 그리는 데 사용할 수 있는 오브젝트
  • 단순 Primitive Shape, Text, Texture 등을 그릴 수 있다.
  • HUD 및 UI를 생성할 때 캔버스를 통해 그리는 방법을 사용한다.

Slate

  • 상호작용이 가능한 UI
  • C++ 전용이다.
  • 플랫폼에 구애받지 않는 커스텀 유저 인터페이스 (언리얼 엔진 에디터에도 해당 UI가 사용되었다.)
  • 서술형 문법을 통해 인디렉션 레이어를 추가하지 않고도 UI 제작이 가능하다.
	SLATE_BEGIN_ARGS( SSubMenuButton )
		: _ShouldAppearHovered( false )
		{}
		/** The label to display on the button */
		SLATE_ATTRIBUTE( FString, Label )
		/** Called when the button is clicked */
		SLATE_EVENT( FOnClicked, OnClicked )
		/** Content to put in the button */
		SLATE_NAMED_SLOT( FArguments, FSimpleSlot, Content )
		/** Whether or not the button should appear in the hovered state */
		SLATE_ATTRIBUTE( bool, ShouldAppearHovered )
	SLATE_END_ARGS()

인디렉션 레이어란? (해당 링크를 참고하였습니다)

  • 일일히 실제 메모리 주소(포인터)에 접근하지 않고, 메모리 용량을 아끼기 위해 사용한다.
  • 가상 메모리 -> 인디렉션 레이어 -> 물리 메모리

UMG (Unreal Motion Graphic)

  • UI 저작 툴
  • Blueprint, C++ 둘 다 사용할 수 있다.
  • UWidget을 조립해서 UI를 만들 수 있다.

UWidget

  • UMG 위젯용 C++ 클래스
  • Slate의 원형 클래스인 SWidget을 래핑한 것
  • 버튼, 체크박스, 슬라이더, 진행 바 등 미리 만들어진 함수 시리즈

Slate vs UMG

  • Slate는 C++ 전용인 반면, UMG는 블루프린트에서 시각적으로 확인할 수 있다는 장점이 있다.
  • UMG는 UWidget으로 이루어져 있으며, UWidget은 SWidget을 래핑한 클래스이기 때문에 Slate와 UMG는 사실상 같은 기술이라 볼 수 있다.

추천하는 사용 방식

  • 주로 블루프린트로 이루어진 게임의 경우, UMG를 사용하기
  • 주로 C++로 이루어진 게임의 경우, UMG와 Custom Slate Widget을 작성해 사용하기 (Custom Slate Widget은 UWidget으로 래핑한 뒤 사용해야함)
  • 모든 Widget의 최상위 컨테이너인 UMG Widget(HUD로 네이밍)을 생성해 사용하기
profile
📝 공부노트

0개의 댓글