RacingWheel.FromGameController(IGameController) 메서드

정의

지정된 게임 컨트롤러를 레이싱 휠로 반환합니다.

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

매개 변수

gameController
IGameController

레이싱 휠로 반환할 게임 컨트롤러입니다.

반환

지정된 게임 컨트롤러에서 반환된 레이싱 휠입니다.

Windows 요구 사항

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

예제

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

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

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

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

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

    racingWheel = RacingWheel::FromGameController(rawGameController);
}

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

설명

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

적용 대상

추가 정보