summaryrefslogtreecommitdiff
path: root/doc/classes/Control.xml
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-03-13 16:02:24 +0100
committerkobewi <kobewi4e@gmail.com>2022-03-13 16:05:08 +0100
commitbcf13dc1756d3668478204eaace47db77942346a (patch)
tree47ef110f8752ef8c95da005cb110e5c7ee305654 /doc/classes/Control.xml
parentc8fce1661da2ed02e94d3edd91fc3f31aa6888cc (diff)
Expose methods for screen-space transforms
Diffstat (limited to 'doc/classes/Control.xml')
-rw-r--r--doc/classes/Control.xml13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index 97fd584ed1..3163ac5610 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -417,6 +417,19 @@
Returns the position and size of the control relative to the top-left corner of the parent Control. See [member position] and [member size].
</description>
</method>
+ <method name="get_screen_position" qualifiers="const">
+ <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]).
+ Example usage for showing a popup:
+ [codeblock]
+ popup_menu.position = get_screen_position() + get_local_mouse_position()
+ popup_menu.reset_size()
+ popup_menu.popup()
+ [/codeblock]
+ </description>
+ </method>
<method name="get_theme_color" qualifiers="const">
<return type="Color" />
<argument index="0" name="name" type="StringName" />