본문 바로가기
RPG Maker MZ/Name Input

Korean Hangul Input (JOHAB) - RPG Maker MZ

by biud436 2020. 8. 9.

Introduction

This plugin allows you to type the text in Korean or English using my Hangul library.

 

Notice that this is worked only in PC platform that has a keyboard.

 


PC 또는 키보드가 있는 환경에서만 동작합니다.

 

HangulInput라는 플러그인 명령을 실행하면 한글 입력 씬이 뜹니다.

 

또는 스크립트 명령 'SceneManager.push(Scene_HangulInput);' 코드를 실행하면 됩니다.

 

입력이 끝나면 지정된 변수에 값이 저장됩니다.

 

 

문자열 비교 방법

변수에 저장된 값을 조건 분기에서 검출하려면 다음과 같이 할 수 있습니다.
문자열을 하나만 비교하려면 다음과 같이 해야 합니다.

 

$gameVariables.value(RS.HangulInput.Params.variableId) === "안녕"

 

예를 들면, 위와 같이 하면 "안녕"이라고 입력했을 때 조건 분기 값이 참이 됩니다.

문자열 두 개 이상 비교하고 둘 중 하나가 참일 때를 알고 싶다면 다음과 같이 해야 합니다.

 

["안녕하세요", "안녕"].contains($gameVariables.value(RS.HangulInput.Params.variableId))

 

맵에 있는 이벤트 중 특정 이름의 위치를 찾아내려면 다음과 같이 해야 합니다.

 

let joinedText = $gameVariables.value(RS.HangulInput.Params.variableId);
let ret = $gameMap.events().filter(e => e.event().name === joinedText);
if(ret && ret[0]) {
  const target = ret[0];
  $gameMessage.add(`아니 내 이름을 어떻게 알았지?`);
} 

 

Download

Github RAW

Github

 

Change Log

2020.08.09 (v1.0.0) - First Release.