mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Allow to specify a custom strength when calling Input.action_press(), this allows virtual axis, mainly for mobile.
This commit is contained in:
parent
a16d9c6ab6
commit
1b0c7515ff
5 changed files with 8 additions and 6 deletions
|
@ -556,14 +556,14 @@ Point2i InputDefault::warp_mouse_motion(const Ref<InputEventMouseMotion> &p_moti
|
|||
void InputDefault::iteration(float p_step) {
|
||||
}
|
||||
|
||||
void InputDefault::action_press(const StringName &p_action) {
|
||||
void InputDefault::action_press(const StringName &p_action, float p_strength) {
|
||||
|
||||
Action action;
|
||||
|
||||
action.physics_frame = Engine::get_singleton()->get_physics_frames();
|
||||
action.idle_frame = Engine::get_singleton()->get_idle_frames();
|
||||
action.pressed = true;
|
||||
action.strength = 0.f;
|
||||
action.strength = p_strength;
|
||||
|
||||
action_state[p_action] = action;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue