diff --git a/doc/classes/WindowServer.xml b/doc/classes/WindowServer.xml new file mode 100644 index 0000000000..ebd5223024 --- /dev/null +++ b/doc/classes/WindowServer.xml @@ -0,0 +1,199 @@ + + + + + + + + + + + + + Centers the window on the screen if in windowed mode. + + + + + + + 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). + + + + + + Returns the window size including decorations like window borders. + + + + + + Returns the number of displays attached to the host machine. + + + + + + + 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. + + + + + + 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. + + + + + + + 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. + + + + + + + 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 < 0: + refresh_rate = 60.0 + [/codeblock] + + + + + + + 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. + + + + + + + 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. + + + + + + Returns [code]true[/code] if the window should always be on top of other windows. + + + + + + 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]. + + + + + + Moves the window to the front. + [b]Note:[/b] This method is implemented on Linux, macWindowServer and Windows. + + + + + + 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. + + + + + + + Sets whether the window should always be on top. + [b]Note:[/b] This method is implemented on Linux, macWindowServer and Windows. + + + + + + The current screen index (starting from 0). + + + 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. + + + 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. + + + If [code]true[/code], removes the window frame. + [b]Note:[/b] Setting [code]window_borderless[/code] to [code]false[/code] disables per-pixel transparency. + + + If [code]true[/code], the window is fullscreen. + + + If [code]true[/code], the window is maximized. + + + If [code]true[/code], the window is minimized. + + + 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. + + + 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. + + + If [code]true[/code], the window is resizable by the user. + + + The size of the window (without counting window manager decorations). + + + + + Display handle: + - Linux: [code]X11::Display*[/code] for the display + + + 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) + + + Window view: + - Windows: [code]HDC[/code] of the main window drawing context + - MacWindowServer: [code]NSView*[/code] of the main windows view (not yet implemented) + + + OpenGL Context: + - Windows: [code]HGLRC[/code] + - Linux: [code]X11::GLXContext[/code] + - MacWindowServer: [code]NSOpenGLContext*[/code] (not yet implemented) + + +