You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 19:41:11 +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:
@@ -520,7 +520,7 @@
|
|||||||
<return type="Transform2D" />
|
<return type="Transform2D" />
|
||||||
<description>
|
<description>
|
||||||
Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
|
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>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_transform" qualifiers="const">
|
<method name="get_transform" qualifiers="const">
|
||||||
|
|||||||
@@ -493,10 +493,14 @@
|
|||||||
<return type="Vector2" />
|
<return type="Vector2" />
|
||||||
<description>
|
<description>
|
||||||
Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
|
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:
|
[b]Example:[/b] Show a popup at the mouse position:
|
||||||
[codeblock]
|
[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.reset_size()
|
||||||
popup_menu.popup()
|
popup_menu.popup()
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
|
|||||||
Reference in New Issue
Block a user