-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy
Description
What problem does this solve or what need does it fill?
When interacting with windows in bevy and positions thereof, bevy_window presents the user with quite a variety of units without too much clarity or direction on why:
// From WindowCommands
resolution: (u32, u32), // window resolution
logical_resolution: (f32, f32), // also window resolution
position: IVec2, // window position
position: Vec2, // cursor position
// From Window
physical_cursor_position: Option<DVec2>, // cursor positionWinit behind the scenes works in either Logical or Physical units for sizes and positions.
physicalmeaning "physical pixels", usually in the form ofu32logicalmeaning "logical pixels" which are f32 / f64 values and usually a helper type to define sizes before any scaling has been applied.
What solution would you like?
I think it would improve consistency if the end user of bevy was encountered with a similar interface. Either by reexporting winit's definitions or by building some new types better suited for bevy's userspace.
What alternative(s) have you considered?
Keep using native types such as vectors and ints to not clutter the userspace with additional types. Most new users will quickly become familiar with Vec2 / IVec2 so keep using that might be preferable? If yes, I'd prefer all tuples become vectors so that we don't mix them.
Metadata
Metadata
Assignees
Labels
A-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with Bevy