InputMap¶
继承: Object
类别: 核心
简要说明¶
管理的单身汉 InputEventAction .
方法¶
无效 |
action_add_event ( String action, InputEvent event ) |
无效 |
action_erase_event ( String action, InputEvent event ) |
无效 |
action_erase_events ( String action ) |
action_has_event ( String action, InputEvent event ) |
|
无效 |
action_set_deadzone ( String action, float deadzone ) |
无效 |
add_action ( String action, float deadzone=0.5 ) |
无效 |
erase_action ( String action ) |
event_is_action ( InputEvent event, String action ) const |
|
get_action_list ( String action ) |
|
get_actions ( ) |
|
has_action ( String action ) const |
|
无效 |
描述¶
管理所有 InputEventAction 可以从“项目设置”菜单创建/修改 Project > Project Settings > Input Map 或者用代码 add_action 和 action_add_event . 见 Node._input .
教程¶
方法说明¶
void action_add_event ( String action, InputEvent event )
添加一个 InputEvent 一个动作。这个 InputEvent 将触发操作。
void action_erase_event ( String action, InputEvent event )
删除 InputEvent 从一个动作。
void action_erase_events ( String action )
从操作中删除所有事件。
bool action_has_event ( String action, InputEvent event )
返回 true
如果动作有给定的 InputEvent 与之相关。
向添加空操作 InputMap
具有可配置的 deadzone
.
安 InputEvent 然后可以添加到此操作 action_add_event .
void erase_action ( String action )
从中删除操作 InputMap
.
bool event_is_action ( InputEvent event, String action ) const
返回 true
如果给定事件是现有操作的一部分。如果给定的 InputEvent 未按下(用于正确的释放检测)。见 action_has_event 如果你不想这样做。
返回的数组 InputEvent 与给定操作关联的。
Array get_actions ( )
返回中所有操作的数组 InputMap
.
返回 true
如果 InputMap
已注册具有给定名称的操作。
void load_from_globals ( )
全部清除 InputEventAction 在 InputMap
从新加载 ProjectSettings .