UDN
Search public documentation:

MobileScreenOrientationKR
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

UE3 홈 > 모바일 홈 > 모바일 화면 방향

모바일 화면 방향


문서 변경내역: Jeff Wilson 작성. 홍성진 번역.

개요


모바일 디바이스에는 보통 세로(portrait)가로(landscape), 두 가지 화면 방향(orientation)이 있습니다. 디바이스를 세로 축이 길 때를 포트레이트, 가로 축이 길 때를 랜드스케이프 모드라 합니다.

portrait.jpg landscape.jpg
세로(Portrait) 가로(Landscape)

언리얼 엔진 3 로 만든 게임은 어느 방향으로도 디자인할 수 있지만, 가로든 세로든 둘 중 한 가지 모드에서만 플레이해야 하며, 플레이 도중에는 바꿀 수 없습니다.

방향 설정


언리얼 엔진 3 로 만든 게임은 기본적으로 가로 모드로 표시되지만, 세로 모드로 해야 하는 경우 수정할 수 있습니다.

iOS 디바이스에서의 방향 설정

iOS 디바이스의 화면 방향 세팅은 .plist 파일에 있습니다. UDKGame/Build/iPhone 디렉토리의 UDKGameOverrides.plist 파일에 세팅을 원하는 대로 추가하여 기본 방향을 설정할 수 있습니다. 화면 방향에 관련된 키는 UIInterfaceOrientationUISupportedInterfaceOrientations (UI 인터페이스 오리엔테이션과 UI 지원 인터페이스 오리엔테이션), 두 가지 입니다. UIInterfaceOrientation (UI 인터페이스 오리엔테이션)은 시동시에 맞출 방향을 결정하는 반면, UISupportedInterfaceOrientations (UI 지원 인터페이스 방향)은 바꿀 수 있는 방향을 나타냅니다. UE3 에서는 UIInterfaceOrientation 세팅만 사용하기는 하지만, 둘 다 적절히 사용하도록 하는 것이 좋습니다.

이 plist 키에 유효한 값은 다음과 같습니다:

portrait_up_th.jpg portrait_down_th.jpg landscape_right_th.jpg landscape_left_th.jpg
UIInterfaceOrientationPortrait (세로) UIInterfaceOrientationPortraitUpsideDown (세로 거꾸로) UIInterfaceOrientationLandscapeRight (가로 우측) UIInterfaceOrientationLandscapeLeft (가로 좌측)

게임이 세로 모드에서 표시되도록 하려면, UDKGameOverrides.plist 파일의 기존 부분 뒤에 다음과 같이 추가하면 됩니다:

<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationPortrait</string>
<key>UISupportedInterfaceOrientations</key>
<array>
   <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>

수정된 파일에는 다음과 같은 부분이 들어 있습니다:

UDKGameOverrides.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
   <dict>
      <key>UIFileSharingEnabled</key>
      <true />
      <key>CFBundleIdentifier</key>
      <string>com.udn.example</string>
      <key>CFBundleName</key>
      <string>MyUDKGame</string>
      <key>CFBundleDisplayName</key>
      <string>UDK Game</string>
      <key>UIInterfaceOrientation</key>
      <string>UIInterfaceOrientationPortrait</string>
        <key>UISupportedInterfaceOrientations</key>
        <array>
          <string>UIInterfaceOrientationPortrait</string>
          <string>UIInterfaceOrientationPortraitUpsideDown</string>
        </array>
   </dict>
</plist>

자동 회전


위에서 본 것처럼 세로든 가로든 각 방향에는 디바이스를 잡은 방향에 따라 두 가지 변종이 있습니다. UE3 모바일 게임은 기본적으로 디바이스에 맞춰 이 두가지 변종 사이에서 자동 회전되도록 작동합니다. 이러한 작동방식이 문제될 일은 별로 없지만, 게임플레이 콘트롤에 있어 디바이스의 기울기(tilt)가 중요한 게임의 경우에는 문제가 될 수 있습니다. 자동 회전 작동방식 제어를 위해 콘솔 명령이 둘 제공됩니다:

mobile enablerotation
자동 회전을 켭니다.
mobile disablerotation
자동 회전을 끕니다.

이 명령은 키즈멧에서 Console Command 액션을 사용하여 맵별로 자동 회전 방식을 조절할 수 있습니다.

자동 회전을 끈 상태로 맵을 시작하려면, 키즈멧을 다음과 같이 쓰면 됩니다:

rotate_kismet.jpg

다른 방법으로는 코드를 통해 명령을 내릴 수도 있는데, 모든 액터에 상속되는 ConsoleCommand() 함수를 사용하면 됩니다. 게임타입이나 플레이어 콘트롤러에서 이런 명령을 쓰면 전체적인 (또는 최소한 게임 단위) 자동 회전 방식을 조절할 수 있습니다.

한 게임타입에 대해 자동 회전을 강제로 끄는 법을 보이는 예제입니다:

MyGameInfo.uc
class MyGameInfo extends SimpleGame;

event InitGame(string Options, out string ErrorMessage)
{
   super.InitGame(Options, ErrorMessage);

   ConsoleCommand("mobile disablerotation");
}