UDN
Search public documentation:
GFxKeyFiltersKR
English Translation
日本語訳
中国翻译
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
日本語訳
中国翻译
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
bCaptureInput, AddCaptureKey, AddFocusIgnoreKey 안내서
문서 변경내역: James Tan 작성. 홍성진 번역.
개요
플레이어가 버튼을 누르거나 아날로그 스틱을 움직일 때 올바르게 반응하게 하려면, 입력을 필터로 걸러 줘야 합니다. 유저 인터페이스의 사용성을 극적으로 향상시킬 수 있는 것입니다.
bCaptureInput
클래스의 defaultproperties 에서 이 옵션을 참으로 설정하면 모든 (마우스, 키보드, 게임 콘트롤러) 인풋을 게임이 아니라 Flash 클래스/SWF 로 전송하며, 거짓으로 설정하면 모든 인풋을 게임으로 전송합니다.
defaultproperties { bCaptureInput=true or false }
AddFocusIgnoreKey
bCaptureInput 를 참으로 설정했을 때 AddFocusIgnoreKey 를 사용하면 일정한 키가 SWF 파일에 캡처되지 않고 그대로 게임으로 통과되도록 할 수 있습니다.
AddFocusIgnoreKey('W');
AddCaptureKey
bCaptureInput 를 거짓으로 설정했을 때 AddCaptureKey 를 사용하면 일정한 키가 게임으로 통과되지 않고 SWF 파일에 캡처되도록 할 수 있습니다.
AddCaptureKey('W');
캡처가능 키 목록 예제
키를 캡처하거나 무시할 때는 다음과 같은 목록을 사용해야 합니다:
- 1 - 0, A - Z, F1 - F12
- Up, Down, Left, Right
- Spacebar, Enter, Escape
- BackSpace, LeftControl, RightControl
- LeftShift, RightShift, PageUp
- PageDown, Home, Insert
- Equals, Minus, Tab
- LeftAlt, RightAlt
- one, two, three, ...
ActionScript 에서 인풋 가로채기
UnrealScript 나 키즈멧을 통해 키를 캡처하는 중이라면, ActionScript 에서 다음과 같은 코드로 그 키 입력을 기다릴 수 있습니다:
import flash.external.ExternalInterface; var keyboardInput:Object = new Object(); // 키보드 입력을 담을 오브젝트를 새로 만듭니다. Key.addListener(keyboardInput); // 키보드 입력을 기다릴 오브젝트를 사용합니다. /* 키가 눌리면 이 함수를 실행합니다. */ keyboardInput.onKeyDown = function() { /* 키보드 입력 ASCII 코드를 'keyPressed' 안에 보관합니다. */ var keyPressed:Number = Key.getCode(); trace("Key Pressed" + keyPressed); /* UnrealScript 함수 'KeyPressed' 를 호출한 다음 거기에 'keyPressed' 값을 전송합니다. */ ExternalInterface.call("KeyPressed", keyPressed); }