You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
InputEventJoypadMotion: Add missing is_pressed() method.
This commit is contained in:
@@ -595,6 +595,11 @@ float InputEventJoypadMotion::get_axis_value() const {
|
|||||||
return axis_value;
|
return axis_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InputEventJoypadMotion::is_pressed() const {
|
||||||
|
|
||||||
|
return Math::abs(axis_value) > 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event) const {
|
bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &p_event) const {
|
||||||
|
|
||||||
Ref<InputEventJoypadMotion> jm = p_event;
|
Ref<InputEventJoypadMotion> jm = p_event;
|
||||||
|
|||||||
@@ -348,6 +348,7 @@ public:
|
|||||||
void set_axis_value(float p_value);
|
void set_axis_value(float p_value);
|
||||||
float get_axis_value() const;
|
float get_axis_value() const;
|
||||||
|
|
||||||
|
virtual bool is_pressed() const;
|
||||||
virtual bool action_match(const Ref<InputEvent> &p_event) const;
|
virtual bool action_match(const Ref<InputEvent> &p_event) const;
|
||||||
|
|
||||||
virtual bool is_action_type() const { return true; }
|
virtual bool is_action_type() const { return true; }
|
||||||
|
|||||||
Reference in New Issue
Block a user