게임 엔진/Unreal

[Unreal] [Editor] [Example] Slate 예제 2

2020. 6. 22. 11:17
목차
  1. Slate Samples

Slate Samples

Unreal editor ui framework인 slate에 대한 예제이다.

 

 

SButton

#include "Widgets/Input/SButton.h"

TSharedPtr<SWidget> FMyPluginModule::Create()
{
	return SNew(SButton)
		.Text(WidgetText)
		.OnClicked(FOnClicked::CreateRaw(this, &FMyPluginModule::OnClickButton));
}


FReply FMyPluginModule::OnClickButton()
{
	UE_LOG(LogTemp, Warning, TEXT("OnClickButton"));

	return FReply::Handled();
}

 

SAssetSearchBox

// "EditorWidgets" Module
#include "SAssetSearchBox.h"

TSharedPtr<SWidget> FMyPluginModule::Create()
{
	return SNew(SAssetSearchBox)
    	.OnTextChanged(FOnTextChanged::CreateRaw(this, &FMyPluginModule::OnSearchBoxChanged))
    	.OnTextCommitted(FOnTextCommitted::CreateRaw(this, &FMyPluginModule::OnSearchBoxCommitted))
    	.DelayChangeNotificationsWhileTyping(true)
    	.HintText(LOCTEXT("SearchHint", "Search..."));
}


// searchbox 내부 텍스트 변경 시 호출
void FMyPluginModule::OnSearchBoxChanged(const FText& InSearchText)
{
	UE_LOG(LogTemp, Warning, TEXT("OnSearchBoxChanged  %s"), *InSearchText.ToString());
}

// searchbox 내부 텍스트 커밋 시 호출
void FMyPluginModule::OnSearchBoxCommitted(const FText& InSearchText, ETextCommit::Type CommitInfo)
{
	UE_LOG(LogTemp, Warning, TEXT("OnSearchBoxCommitted  %s"), *InSearchText.ToString());
}

 

AssetSelector

// "AssetManagerEditor" Module
#include "AssetManagerEditorModule.h"


TSharedPtr<SWidget> FMyPluginModule::Create()
{
	return IAssetManagerEditorModule::MakePrimaryAssetTypeSelector(
		FOnGetPrimaryAssetDisplayText::CreateRaw(this, &FMyPluginModule::GetDisplayText),
		FOnSetPrimaryAssetType::CreateRaw(this, &FMyPluginModule::OnTypeSelected));
}


FText FMyPluginModule::GetDisplayText() const
{
	return FText::FromString(FString(TEXT("ABCDEFG!!")));
}

void FMyPluginModule::OnIdSelected(FPrimaryAssetId AssetId)
{
	UE_LOG(LogTemp, Warning, TEXT("OnIdSelected !!!!!!!!!!!!!!!!!!!!!!!   %s"), *AssetId.ToString());
}

 

 

Notification Popup

void FMyPluginModule::OnConsoleCommand2()
{
	const FText NotificationErrorText = LOCTEXT("MyNotification", "write some text here.");
		
	FNotificationInfo Info(NotificationErrorText);
	Info.ExpireDuration = 5.0f;
	FSlateNotificationManager::Get().AddNotification(Info);
}

 

 

 

Message Dialog

...
	FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("message here!")));
...

 

 

 

 

 

 

 

'게임 엔진 > Unreal' 카테고리의 다른 글

[Unreal] [Editor] Slate를 이용한 에셋 경로 설정 다이얼로그 제작  (0) 2020.06.24
[Unreal] [Editor] [Example] Slate 예제 1  (0) 2020.06.22
[Unreal] [Editor] Unreal Plugin 제작 방법  (0) 2020.06.16
[Unreal] Animation Notify를 이용한 충돌처리 (AnimNotify, Collision)  (0) 2020.06.14
[Unreal] Physics Body의 기하 정보를 이용한 충돌처리  (0) 2020.06.13
  1. Slate Samples
'게임 엔진/Unreal' 카테고리의 다른 글
  • [Unreal] [Editor] Slate를 이용한 에셋 경로 설정 다이얼로그 제작
  • [Unreal] [Editor] [Example] Slate 예제 1
  • [Unreal] [Editor] Unreal Plugin 제작 방법
  • [Unreal] Animation Notify를 이용한 충돌처리 (AnimNotify, Collision)
AlgorFati
AlgorFati
algorfati@gmail.com
AlgorFati
AlgorFati의 개발 기록
AlgorFati
전체
오늘
어제
  • 분류 전체보기 (111)
    • 경제 (0)
    • 서비스 운영 (3)
    • 시행착오 (1)
    • 프로그래밍 (50)
      • CS 개념 (3)
      • 알고리즘 (32)
      • C++ (7)
      • C# (3)
      • OS (1)
      • Python (4)
    • 사업 (0)
    • Back End (1)
    • 생활 (1)
    • 정보 보안 (0)
    • 게임 개발 (1)
    • Tool (2)
    • 기술 (0)
    • AI (2)
    • 게임 엔진 (50)
      • Unreal (36)
      • Unity (14)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • geom
  • 취업
  • data asset
  • 프로그래머스
  • 알고리즘
  • Slate
  • 비동기 프로그래밍
  • Event Handling
  • 코딩테스트
  • Nullable
  • asset to editor
  • Editor
  • Collision
  • aggregate geom
  • 대기업
  • ml agent
  • Animation
  • customize
  • Unreal
  • pathfinding
  • TickGroup
  • navmesh
  • unity
  • hp bar
  • 카카오
  • 불변성
  • property editor
  • c#
  • Serialize
  • debug draw

최근 댓글

최근 글

hELLO · Designed By 정상우.
AlgorFati
[Unreal] [Editor] [Example] Slate 예제 2
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.