此函数可用于检测给定设备的模拟按钮的当前阈值设置。所有模拟按钮的默认阈值均为 0.5,范围为 0 到 1。阈值定义了在要求按钮充当数字按钮的游戏中,按钮在什么时候被视为 “按下”。
gamepad_get_button_threshold(device);
参数 | 类型 | 描述 |
---|---|---|
device | Real | 要检查哪个游戏手柄设备 “插槽”。 |
if (gamepad_get_button_threshold(0) != 0.5)
{
gamepad_set_button_threshold(0, 0.5);
}
上述代码检查连接到设备 “插槽” 0的游戏手柄的模拟按钮阈值,如果它不是0.5的默认值,则将其设置为该值。