Improve documentation on _input_event 2d and 3d#120659
Open
leandro-benedet-garcia wants to merge 1 commit into
Open
Improve documentation on _input_event 2d and 3d#120659leandro-benedet-garcia wants to merge 1 commit into
_input_event 2d and 3d#120659leandro-benedet-garcia wants to merge 1 commit into
Conversation
AThousandShips
left a comment
Member
There was a problem hiding this comment.
And same for the 3D one
| [InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object. | ||
| [param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true. | ||
| [param shape_idx] is the child index of the clicked [Shape2D]. This is unrelated to the scene tree, this value comes from the physics server, to properly use the index you need to use the methods related to them from [PhysicsServer2D]. | ||
| See also [method Node._unhandled_input] |
Member
There was a problem hiding this comment.
Suggested change
| See also [method Node._unhandled_input] | |
| See also [method Node._unhandled_input]. |
| [InputEventMouseButton] for when a mouse button is pressed. | ||
| [InputEventScreenTouch] for when the object is pressed via a touchscreen. | ||
| [InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object. | ||
| [param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true. |
Member
There was a problem hiding this comment.
Suggested change
| [param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true. | |
| [param viewport] is the [Viewport] that the event originated in, for viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to [code]true[/code]. |
| <param index="2" name="shape_idx" type="int" /> | ||
| <description> | ||
| Accepts unhandled [InputEvent]s. [param shape_idx] is the child index of the clicked [Shape2D]. Connect to [signal input_event] to easily pick up these events. | ||
| Detects unhandled Mouse and Touch [InputEvent]s through [param event] when events happen on top of the object. The events are: |
Member
There was a problem hiding this comment.
Suggested change
| Detects unhandled Mouse and Touch [InputEvent]s through [param event] when events happen on top of the object. The events are: | |
| Detects unhandled mouse and touch [InputEvent]s through [param event] when events happen on top of the object. The events are: |
Also don't think "on top of" is the best phrasing here
| [InputEventMouseMotion] for when the mouse moves. | ||
| [InputEventMouseButton] for when a mouse button is pressed. | ||
| [InputEventScreenTouch] for when the object is pressed via a touchscreen. | ||
| [InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object. |
Member
There was a problem hiding this comment.
when starting or not at the object
What does this mean?
| [InputEventScreenTouch] for when the object is pressed via a touchscreen. | ||
| [InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object. | ||
| [param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true. | ||
| [param shape_idx] is the child index of the clicked [Shape2D]. This is unrelated to the scene tree, this value comes from the physics server, to properly use the index you need to use the methods related to them from [PhysicsServer2D]. |
Member
There was a problem hiding this comment.
This is unnecessarily verbose and vague IMO
_input_event 2d and 3d_input_event 2d and 3d
17ffc65 to
25f89b0
Compare
25f89b0 to
2d94004
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old description for
_input_eventprovided no near enough information about those methods and signals considering how much it actually can do, or does in general.So I delved into the source code and tested behaviors in general to see how it actually worked, and I might still be missing something.
It might be worth mentioning also about https://docs.godotengine.org/en/stable/classes/class_projectsettings.html#class-projectsettings-property-input-devices-pointing-emulate-mouse-from-touch but I am not exactly sure how to phrase it.