Module window

Available on crate feature dep_miniquad only.
Expand description

Window and associated to window rendering context related functions. in macroquad <= 0.3, it was ctx.screen_size(). Now it is window::screen_size()

Functions§

blocking_event_loop
cancel_quit
Cancels a pending quit request, either initiated by the user clicking the window close button, or programmatically by calling “request_quit()”. The only place where calling this function makes sense is from inside the event handler callback when the “quit_requested_event” event has been received
clipboard_get
Get current OS clipboard value
clipboard_set
Save value to OS clipboard
dpi_scale
The dpi scaling factor (window pixels to framebuffer pixels) NOTE: High DPI Rendering
dropped_file_bytes
dropped_file_count
dropped_file_path
get_window_position
Get the position of the window. TODO: implement for other platforms
high_dpi
True when high_dpi was requested and actually running in a high-dpi scenario NOTE: High DPI Rendering
new_rendering_backend
The same as
order_quit
This function simply quits the application without giving the user a chance to intervene. Usually this might be called when the user clicks the ‘Ok’ button in a ‘Really Quit?’ dialog box Window might not be actually closed right away (exit(0) might not happen in the order_quit implmentation) and execution might continue for some time after But the window is going to be inevitably closed at some point.
quit
Shortcut for order_quit. Will add a legacy attribute at some point.
request_quit
Calling request_quit() will trigger “quit_requested_event” event , giving the user code a chance to intervene and cancel the pending quit process (for instance to show a ‘Really Quit?’ dialog box). If the event handler callback does nothing, the application will be quit as usual. To prevent this, call the function “cancel_quit()”“ from inside the event handler.
schedule_update
With conf.platform.blocking_event_loop, schedule_update called from an event handler makes draw()/update() functions to be called without waiting for a next event.
screen_size
The current framebuffer size in pixels NOTE: High DPI Rendering
set_cursor_grab
Capture mouse cursor to the current window On WASM this will automatically hide cursor On desktop this will bound cursor to windows border NOTICE: on desktop cursor will not be automatically released after window lost focus so set_cursor_grab(false) on window’s focus lost is recommended. TODO: implement window focus events
set_fullscreen
set_mouse_cursor
Set the mouse cursor icon.
set_window_position
set_window_size
Set the application’s window size.
show_keyboard
Show/hide onscreen keyboard. Only works on Android right now.
show_mouse
Show or hide the mouse cursor