Window

object Window

The window management object.

Types

Link copied to clipboard
value class State

The various windows state flags available.

Properties

Link copied to clipboard

The image stored in the system clipboard.

Link copied to clipboard

The system clipboard text.

Link copied to clipboard

The current window title.

Link copied to clipboard

Indicates whether the window is currently focused.

Link copied to clipboard
var fps: Int

The target frames per second in the window.

Link copied to clipboard

The number of seconds since the last frame was drawn.

Link copied to clipboard

The state of fullscreen on the window.

Link copied to clipboard

Indicates whether the window is hidden from view.

Link copied to clipboard

Indicates whether the system is running in headless mode (no monitors connected).

Link copied to clipboard

Indicates whether the window is currently maximized.

Link copied to clipboard

Indicates whether the window is currently minimized.

Link copied to clipboard

The number of monitors connected to the system.

Link copied to clipboard

The height of the current monitor.

Link copied to clipboard

The current monitor ID.

Link copied to clipboard

The name of the current monitor.

Link copied to clipboard

The physical height of the current monitor in millimeters.

Link copied to clipboard

The physical width of the current monitor in millimeters.

Link copied to clipboard

The current refresh rate of the monitor in Hz.

Link copied to clipboard

The width of the current monitor.

Link copied to clipboard

The X position of the current monitor in pixels.

Link copied to clipboard

The Y position of the current monitor in pixels.

Link copied to clipboard

Indicates whether the window has been initialized successfully.

Link copied to clipboard

The height of the render area.

Link copied to clipboard

The width of the render area.

Link copied to clipboard

The height of the current screen.

Link copied to clipboard

The width of the current screen.

Link copied to clipboard

Whether the window should close.

Link copied to clipboard

The number of seconds since open was called.

Link copied to clipboard

Indicates whether the window has been resized in the last frame.

Link copied to clipboard

The current scale factor of the window on the X axis for HighDPI support.

Link copied to clipboard

The current scale factor of the window on the Y axis for HighDPI support.

Link copied to clipboard

The X position of the window on the screen.

Link copied to clipboard

The Y position of the window on the screen.

Functions

Link copied to clipboard
fun close()

Closes the window.

Link copied to clipboard
fun delaySync(ms: Int)

Delays execution for the specified number of milliseconds. This operation is not thread safe.

Link copied to clipboard

Disables waiting for events when canvas drawing is finished.

Link copied to clipboard

Enables waiting for events when canvas drawing is finished.

Link copied to clipboard

Ends rendering to the current RenderTexture2D and returns to the default framebuffer.

Link copied to clipboard
fun getColor(x: Int, y: Int): Color

Gets the color of the pixel at the specified screen coordinates.

Link copied to clipboard

Determines if a specific window flag is enabled.

Link copied to clipboard
fun lifecycle(loop: Window.() -> Unit)

Runs a game loop while shouldClose is false.

Link copied to clipboard
fun lifecycleForFrames(frames: Int, loop: Window.(Int) -> Unit)

Runs a game loop for a specific number of frames.

Link copied to clipboard
fun lifecycleForTime(seconds: Double, loop: Window.() -> Unit)

Runs a game loop for a specific duration in seconds.

Link copied to clipboard
fun maximize()

Maximizes the window.

Link copied to clipboard
fun minimize()

Minimizes the window.

Link copied to clipboard
fun open(width: Int, height: Int, title: String = "Raylib Window", loop: Window.() -> Unit? = null, targetFps: Int? = null)

Initializes the window with the specified width, height, and title.

Link copied to clipboard
fun restore()

Restores the window to its normal state that isn't minimized or maximized.

Link copied to clipboard

Sets specific window state flags.

Link copied to clipboard

Starts rendering to the specified RenderTexture2D.

Link copied to clipboard
fun Window.textureMode(renderTexture: RenderTexture2D, block: Window.() -> Unit)

Executes a block of code while rendering to the specified RenderTexture2D.

Link copied to clipboard

Toggles the borderless windowed mode of the window.

Link copied to clipboard

Toggles the fullscreen state of the window.