mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #112952 from MadeScientist/MadeScientist-patch-1
Fix incorrect equivalent method reference in screen-space transform methods doc
This commit is contained in:
commit
a5bb19a0d2
2 changed files with 7 additions and 3 deletions
|
|
@ -520,7 +520,7 @@
|
|||
<return type="Transform2D" />
|
||||
<description>
|
||||
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]).
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_transform" qualifiers="const">
|
||||
|
|
|
|||
|
|
@ -493,10 +493,14 @@
|
|||
<return type="Vector2" />
|
||||
<description>
|
||||
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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue