#windows

bevy_windows_param

Bevy SystemParam providing a more ergonomic interface for accessing window-specific information, like resolutions and cursor positions

2 releases

0.1.1 May 10, 2023
0.1.0 May 10, 2023

#2241 in Game dev

MIT/Apache

25KB
177 lines

bevy_windows_param

crates.io MIT/Apache 2.0 crates.io

bevy_windows_param::Windows is a Bevy SystemParam providing a more ergonomic interface for accessing window-specific information, like resolutions and cursor positions."

The implemented methods include:

  • get_window: Retrieves a Window
  • resolution: Returns the logical resolution of a window
  • physical_resolution: Returns the physical resolution of a window
  • scale_factor: Returns the scale factor of a window
  • cursor_position: Determines the window over which the cursor is positioned, as well as the cursor's location within that window.
  • ui_cursor_position: Similar to cursor_position, but returns the cursor's position in UI coordinates.
  • world_cursor_position: Similar to cursor_position, but returns the cursor's position in world coordinates.

Supports Bevy version 0.10

Examples

  • cargo run --example cursor_position
  • cargo run --example multiple_windows

Dependencies

~20–55MB
~1M SLoC