Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose viewport gui_find_control to scripting #86343

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/classes/Viewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@
Returns the visible rectangle in global screen coordinates.
</description>
</method>
<method name="gui_find_control">
<return type="Control" />
<param index="0" name="point" type="Vector2" />
<description>
Returns the [Control] that would be under the mouse cursor if the mouse cursor were located at the viewport coordinates provided by the point parameter. Returns null if there is no [Control] at that point.
</description>
</method>
<method name="gui_get_drag_data" qualifiers="const">
<return type="Variant" />
<description>
Expand Down
2 changes: 2 additions & 0 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4564,6 +4564,8 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("gui_get_focus_owner"), &Viewport::gui_get_focus_owner);
ClassDB::bind_method(D_METHOD("gui_get_hovered_control"), &Viewport::gui_get_hovered_control);

ClassDB::bind_method(D_METHOD("gui_find_control", "point"), &Viewport::gui_find_control);

ClassDB::bind_method(D_METHOD("set_disable_input", "disable"), &Viewport::set_disable_input);
ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled);

Expand Down
Loading