Module miniquad::window

source ·
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§

  • 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
  • Get current OS clipboard value
  • Save value to OS clipboard
  • The dpi scaling factor (window pixels to framebuffer pixels) NOTE: High DPI Rendering
  • True when high_dpi was requested and actually running in a high-dpi scenario NOTE: High DPI Rendering
  • The same as
  • 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.
  • Shortcut for order_quit. Will add a legacy attribute at some point.
  • 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.
  • 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.
  • The current framebuffer size in pixels NOTE: High DPI Rendering
  • 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 the mouse cursor icon.
  • Set the application’s window size.
  • Show/hide onscreen keyboard. Only works on Android right now.
  • Show or hide the mouse cursor