語言

RawGameController.GetButtonLabel(Int32) 方法

定義

擷取指定按鈕的按鈕標籤。

public:
 virtual GameControllerButtonLabel GetButtonLabel(int buttonIndex) = GetButtonLabel;
GameControllerButtonLabel GetButtonLabel(int const& buttonIndex);
public GameControllerButtonLabel GetButtonLabel(int buttonIndex);
function getButtonLabel(buttonIndex)
Public Function GetButtonLabel (buttonIndex As Integer) As GameControllerButtonLabel

參數

buttonIndex
Int32

int

要擷取標籤的按鈕。

傳回

指定按鈕的標籤。 如果按鈕標籤是空白的,或控制器的按鈕沒有已知的標籤,則會傳回 None 。

備註

不同于其他類別的 GetButtonLabel 成員函式,例如 ArcadeStick.GetButtonLabel,此函式會採用整數,而不是 ArcadeStickButtons 或其他列舉值。 這個整數是原始遊戲控制器按鈕陣列中的索引。

您可以建立自己的按鈕陣列,然後使用 RawGameController.GetCurrentReading來填入代表每個按鈕狀態的值。 如需詳細資訊,請參閱 原始遊戲控制器 。

適用於

另請參閱