mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current master branch (4b6c88d)
This commit is contained in:
@@ -37,7 +37,7 @@ Call :ref:`accept_event()<class_Control_method_accept_event>` so no other node r
|
||||
|
||||
Only one **Control** node can be in focus. Only the node in focus will receive events. To get the focus, call :ref:`grab_focus()<class_Control_method_grab_focus>`. **Control** nodes lose focus when another node grabs it, or if you hide the node in focus. Focus will not be represented visually if gained via mouse/touch input, only appearing with keyboard/gamepad input (for accessibility), or via :ref:`grab_focus()<class_Control_method_grab_focus>`.
|
||||
|
||||
Sets :ref:`mouse_filter<class_Control_property_mouse_filter>` to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>` to tell a **Control** node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
|
||||
Set :ref:`mouse_filter<class_Control_property_mouse_filter>` to :ref:`MOUSE_FILTER_IGNORE<class_Control_constant_MOUSE_FILTER_IGNORE>` to tell a **Control** node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
|
||||
|
||||
\ :ref:`Theme<class_Theme>` resources change the control's appearance. The :ref:`theme<class_Control_property_theme>` of a **Control** node affects all of its direct and indirect children (as long as a chain of controls is uninterrupted). To override some of the theme items, call one of the ``add_theme_*_override`` methods, like :ref:`add_theme_font_override()<class_Control_method_add_theme_font_override>`. You can also override theme items in the Inspector.
|
||||
|
||||
@@ -3041,13 +3041,17 @@ Returns the position and size of the control in the coordinate system of the con
|
||||
|
||||
Returns the position of this **Control** in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
|
||||
|
||||
Equals to :ref:`global_position<class_Control_property_global_position>` if the window is embedded (see :ref:`Viewport.gui_embed_subwindows<class_Viewport_property_gui_embed_subwindows>`).
|
||||
Equivalent to ``get_screen_transform().origin`` (see :ref:`CanvasItem.get_screen_transform()<class_CanvasItem_method_get_screen_transform>`).
|
||||
|
||||
\ **Example:** Show a popup at the mouse position:
|
||||
|
||||
::
|
||||
|
||||
popup_menu.position = get_screen_position() + get_local_mouse_position()
|
||||
popup_menu.position = get_screen_position() + get_screen_transform().basis_xform(get_local_mouse_position())
|
||||
|
||||
# The above code is equivalent to:
|
||||
popup_menu.position = get_screen_transform() * get_local_mouse_position()
|
||||
|
||||
popup_menu.reset_size()
|
||||
popup_menu.popup()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user