> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::GetControllerAxisLabels

> 장치에 있는 일반 컨트롤러 축의 레이블을 검색합니다.

장치에 있는 일반 컨트롤러 축의 레이블을 검색합니다.

## 구문

```cpp theme={null}
uint32_t GetControllerAxisLabels(
    uint32_t labelArrayCount,
    GameInputLabel* labelArray
);
```

### 매개변수

*labelArrayCount*   \_In\_\
형식: uint32\_t

*labelArray*의 요소 수입니다. 모든 컨트롤러 축 레이블을 검색하려면 [GetControllerAxisCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxiscount.md)가 반환하는 값을 전달하세요.

*labelArray*   \_Out\_writes\_to\_opt\_(labelArrayCount, return)\
형식: [GameInputLabel](https://docs.xbox.com/ko/reference/input/gameinput/enums/gameinputlabel.md)\*

컨트롤러 축당 하나의 레이블을 받는 배열에 대한 포인터입니다. `nullptr`일 수 있으며, 이 경우 아무것도 기록되지 않고 메서드는 0을 반환합니다.

### 반환값

형식: uint32\_t

*labelArray*에 기록된 요소 수입니다. *labelArrayCount*와 장치의 컨트롤러 축 레이블 수 중 작은 값이며, *labelArray*가 `nullptr`이거나 장치에 컨트롤러 축 레이블이 없으면 0입니다.

## 설명

각 요소는 장치가 보고하는 경우 해당 축에 인쇄된 표시를 식별하는 [GameInputLabel](https://docs.xbox.com/ko/reference/input/gameinput/enums/gameinputlabel.md) 값입니다.

[GetControllerAxisCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxiscount.md)를 호출하여 컨트롤러 축 레이블 수를 가져오고, 해당 크기의 배열을 할당한 다음, `GetControllerAxisLabels`를 호출하여 배열을 채우세요. *labelArrayCount*가 컨트롤러 축 레이블 수보다 작으면 처음 *labelArrayCount*개의 요소만 기록됩니다. 장치의 컨트롤러 축 레이블은 장치가 연결되어 있는 동안 변경되지 않으므로 한 번 쿼리하고 결과를 캐시할 수 있습니다.

레이블 배열의 요소 *i*는 이 장치의 판독값에 대해 [IGameInputReading::GetControllerAxisState](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)가 반환하는 배열의 인덱스 *i*에 있는 축을 설명합니다.

다음 예제는 장치의 컨트롤러 축 레이블을 검색하는 방법을 보여줍니다.

```cpp theme={null}
uint32_t axisCount = device->GetControllerAxisCount();
std::vector<GameInputLabel> axisLabels(axisCount);
axisLabels.resize(device->GetControllerAxisLabels(axisCount, axisLabels.data()));

std::vector<float> axisStates(reading->GetControllerAxisCount());
reading->GetControllerAxisState(static_cast<uint32_t>(axisStates.size()), axisStates.data());

for (size_t i = 0; i < axisLabels.size() && i < axisStates.size(); ++i)
{
    // axisLabels[i] is the label of the axis whose value is axisStates[i].
}
```

GameInput v3 이하에서는 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)가 반환하는 [GameInputDeviceInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 구조체의 `controllerInfo` 멤버가 참조하는 [GameInputControllerInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/structs/gameinputcontrollerinfo.md) 구조체의 `controllerAxisLabels` 멤버에서 이 정보를 얻을 수 있었습니다.

## 요구 사항

**헤더:** GameInput.h

**라이브러리:** gameinput.lib

**지원되는 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[GameInput 개요](https://docs.xbox.com/ko/build/core-features/common/input/overviews/input-overview.md)\
[GetControllerAxisCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxiscount.md)\
[GameInputLabel](https://docs.xbox.com/ko/reference/input/gameinput/enums/gameinputlabel.md)\
[IGameInputReading::GetControllerAxisState](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxisstate.md)\
[IGameInputDevice](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 버전 기록

| 버전 | 변경 사항 |
| - | - |
| **v4** | 도입됨. |


## Related topics

- [GameInputLabel](https://docs.xbox.com/ko/reference/input/gameinput/enums/gameinputlabel.md)
- [IGameInputDevice::GetControllerAxisCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxiscount.md)
- [IGameInputDevice::GetControllerButtonLabels](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttonlabels.md)
- [IGameInputDevice::GetControllerButtonCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttoncount.md)
- [IGameInputDevice::GetControllerSwitchCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerswitchcount.md)
