diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 6ddcfd5a853..1571e39da54 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -520,7 +520,7 @@ Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. - Equals to [method get_global_transform] if the window is embedded (see [member Viewport.gui_embed_subwindows]). + Equivalent to [method get_global_transform_with_canvas] if the window is embedded (see [member Viewport.gui_embed_subwindows]). diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index da2f62a9772..55111898f9a 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -493,10 +493,14 @@ Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. - Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]). + Equivalent to [code]get_screen_transform().origin[/code] (see [method CanvasItem.get_screen_transform]). [b]Example:[/b] Show a popup at the mouse position: [codeblock] - 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() [/codeblock]