Share via


UINavigationController.FromGameController(IGameController) 메서드

정의

지정된 게임 컨트롤러를 UI 탐색 컨트롤러로 반환합니다.

public:
 static UINavigationController ^ FromGameController(IGameController ^ gameController);
 static UINavigationController FromGameController(IGameController const& gameController);
public static UINavigationController FromGameController(IGameController gameController);
function fromGameController(gameController)
Public Shared Function FromGameController (gameController As IGameController) As UINavigationController

매개 변수

gameController
IGameController

UI 탐색 컨트롤러로 반환될 게임 컨트롤러입니다.

반환

지정된 게임 컨트롤러에서 반환된 UI 탐색 컨트롤러입니다.

Windows 요구 사항

디바이스 패밀리
Windows 10 Creators Update (10.0.15063.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v4.0에서 도입되었습니다.)

예제

다음 예제에서 앱은 사용 가능한 첫 번째 RawGameController 개체를 가져오고 UINavigationController 클래스를 통해 이 게임 컨트롤러에 액세스하려고 시도합니다.

#include <winrt/Windows.Gaming.Input.h>
using namespace winrt;
using namespace Windows::Gaming::Input;
...
UINavigationController uiNavigationController{ nullptr };

if (RawGameController::RawGameControllers().Size() > 0)
{
    RawGameController rawGameController{ RawGameController::RawGameControllers().GetAt(0) };
    uiNavigationController = UINavigationController::FromGameController(rawGameController);
}

if (uiNavigationController)
{
    // Assign a standard button mapping to this controller.
}
UINavigationController^ uiNavigationController;

if (RawGameController::RawGameControllers->Size > 0)
{
    RawGameController^ rawGameController = 
        RawGameController::RawGameControllers->GetAt(0);

    uiNavigationController = 
        UINavigationController::FromGameController(rawGameController);
}

if (uiNavigationController != nullptr)
{
    // Assign a standard button mapping to this controller.
}

설명

이 메서드는 제공된 게임 컨트롤러에 UI 탐색 컨트롤러 구현이 있는지 확인하고, 그렇다면 해당 구현을 반환합니다. 먼저 컨트롤러를 RawGameController로 가져와서 UINavigationController로 사용할 수 있는지 확인하려는 경우 이 메서드를 사용할 수 있습니다. 이 경우 UI 탐색 컨트롤러에 대한 기본 제어 체계를 사용할 수 있습니다. 그렇지 않으면 플레이어가 자신의 입력 매핑을 수행하도록 할 수 있습니다.

적용 대상

추가 정보