RawGameController.GetButtonLabel(Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检索指定按钮的按钮标签。
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 。
注解
与其他类(如 ArcadeStick.GetButtonLabel)的 GetButtonLabel 成员函数不同,此函数采用整数,而不是 ArcadeStickButtons 或其他枚举值。 此整数是原始游戏控制器按钮数组的索引。
可以创建自己的按钮数组,然后使用 RawGameController.GetCurrentReading 使用表示每个按钮状态的值填充该数组。 有关详细信息 ,请参阅原始游戏控制器 。