pandemonium_engine/doc/classes/WindowServer.xml

200 lines
9.9 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<class name="WindowServer" inherits="Object" version="4.2">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="center_window">
<return type="void" />
<description>
Centers the window on the screen if in windowed mode.
</description>
</method>
<method name="get_native_handle">
<return type="int" />
<argument index="0" name="handle_type" type="int" enum="WindowServer.HandleType" />
<description>
Returns internal structure pointers for use in GDNative plugins.
[b]Note:[/b] This method is implemented on Linux and Windows (other WindowServers will soon be supported).
</description>
</method>
<method name="get_real_window_size" qualifiers="const">
<return type="Vector2" />
<description>
Returns the window size including decorations like window borders.
</description>
</method>
<method name="get_screen_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of displays attached to the host machine.
</description>
</method>
<method name="get_screen_dpi" qualifiers="const">
<return type="int" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the dots per inch density of the specified screen. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
[b]Note:[/b] On macWindowServer, returned value is inaccurate if fractional display scaling mode is used.
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
[codeblock]
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
[/codeblock]
[b]Note:[/b] This method is implemented on Android, Linux, macWindowServer and Windows. Returns [code]72[/code] on unsupported platforms.
</description>
</method>
<method name="get_screen_max_scale" qualifiers="const">
<return type="float" />
<description>
Return the greatest scale factor of all screens.
[b]Note:[/b] On macWindowServer returned value is [code]2.0[/code] if there is at least one hiDPI (Retina) screen in the system, and [code]1.0[/code] in all other cases.
[b]Note:[/b] This method is implemented on macWindowServer.
</description>
</method>
<method name="get_screen_position" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the position of the specified screen by index. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
</description>
</method>
<method name="get_screen_refresh_rate" qualifiers="const">
<return type="float" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the current refresh rate of the specified screen. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
[b]Note:[/b] Returns [code]-1.0[/code] if Pandemonium fails to find the refresh rate for the specified screen. On HTML5, [method get_screen_refresh_rate] will always return [code]-1.0[/code] as there is no way to retrieve the refresh rate on that platform.
To fallback to a default refresh rate if the method fails, try:
[codeblock]
var refresh_rate = WindowServer.get_screen_refresh_rate()
if refresh_rate &lt; 0:
refresh_rate = 60.0
[/codeblock]
</description>
</method>
<method name="get_screen_scale" qualifiers="const">
<return type="float" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Return the scale factor of the specified screen by index. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
[b]Note:[/b] On macWindowServer returned value is [code]2.0[/code] for hiDPI (Retina) screen, and [code]1.0[/code] for all other cases.
[b]Note:[/b] This method is implemented on macWindowServer.
</description>
</method>
<method name="get_screen_size" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="screen" type="int" default="-1" />
<description>
Returns the dimensions in pixels of the specified screen. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
</description>
</method>
<method name="is_window_always_on_top" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the window should always be on top of other windows.
</description>
</method>
<method name="is_window_focused" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if the window is currently focused.
[b]Note:[/b] Only implemented on desktop platforms. On other platforms, it will always return [code]true[/code].
</description>
</method>
<method name="move_window_to_foreground">
<return type="void" />
<description>
Moves the window to the front.
[b]Note:[/b] This method is implemented on Linux, macWindowServer and Windows.
</description>
</method>
<method name="request_attention">
<return type="void" />
<description>
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on WindowServerX.
[b]Note:[/b] This method is implemented on Linux, macWindowServer and Windows.
</description>
</method>
<method name="set_window_always_on_top">
<return type="void" />
<argument index="0" name="enabled" type="bool" />
<description>
Sets whether the window should always be on top.
[b]Note:[/b] This method is implemented on Linux, macWindowServer and Windows.
</description>
</method>
</methods>
<members>
<member name="current_screen" type="int" setter="set_current_screen" getter="get_current_screen">
The current screen index (starting from 0).
</member>
<member name="max_window_size" type="Vector2" setter="set_max_window_size" getter="get_max_window_size">
The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system default value.
</member>
<member name="min_window_size" type="Vector2" setter="set_min_window_size" getter="get_min_window_size">
The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system's default value.
[b]Note:[/b] By default, the project window has a minimum size of [code]Vector2(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size.
</member>
<member name="window_borderless" type="bool" setter="set_borderless_window" getter="get_borderless_window">
If [code]true[/code], removes the window frame.
[b]Note:[/b] Setting [code]window_borderless[/code] to [code]false[/code] disables per-pixel transparency.
</member>
<member name="window_fullscreen" type="bool" setter="set_window_fullscreen" getter="is_window_fullscreen">
If [code]true[/code], the window is fullscreen.
</member>
<member name="window_maximized" type="bool" setter="set_window_maximized" getter="is_window_maximized">
If [code]true[/code], the window is maximized.
</member>
<member name="window_minimized" type="bool" setter="set_window_minimized" getter="is_window_minimized">
If [code]true[/code], the window is minimized.
</member>
<member name="window_per_pixel_transparency_enabled" type="bool" setter="set_window_per_pixel_transparency_enabled" getter="get_window_per_pixel_transparency_enabled">
If [code]true[/code], the window background is transparent and the window frame is removed.
Use [code]get_tree().get_root().set_transparent_background(true)[/code] to disable main viewport background rendering.
[b]Note:[/b] This property has no effect if [member ProjectSettings.display/window/per_pixel_transparency/allowed] setting is disabled.
[b]Note:[/b] This property is implemented on HTML5, Linux, macWindowServer, Windows, and Android. It can't be changed at runtime for Android. Use [member ProjectSettings.display/window/per_pixel_transparency/enabled] to set it at startup instead.
</member>
<member name="window_position" type="Vector2" setter="set_window_position" getter="get_window_position">
The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right.
</member>
<member name="window_resizable" type="bool" setter="set_window_resizable" getter="is_window_resizable">
If [code]true[/code], the window is resizable by the user.
</member>
<member name="window_size" type="Vector2" setter="set_window_size" getter="get_window_size">
The size of the window (without counting window manager decorations).
</member>
</members>
<constants>
<constant name="DISPLAY_HANDLE" value="0" enum="HandleType">
Display handle:
- Linux: [code]X11::Display*[/code] for the display
</constant>
<constant name="WINDOW_HANDLE" value="1" enum="HandleType">
Window handle:
- Windows: [code]HWND[/code] of the main window
- Linux: [code]X11::Window*[/code] of the main window
- MacWindowServer: [code]NSWindow*[/code] of the main window (not yet implemented)
- Android: [code]jObject[/code] the main android activity (not yet implemented)
</constant>
<constant name="WINDOW_VIEW" value="2" enum="HandleType">
Window view:
- Windows: [code]HDC[/code] of the main window drawing context
- MacWindowServer: [code]NSView*[/code] of the main windows view (not yet implemented)
</constant>
<constant name="OPENGL_CONTEXT" value="3" enum="HandleType">
OpenGL Context:
- Windows: [code]HGLRC[/code]
- Linux: [code]X11::GLXContext[/code]
- MacWindowServer: [code]NSOpenGLContext*[/code] (not yet implemented)
</constant>
</constants>
</class>