mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
f7ea93a7cf
# Objective Improve the documentation relating to windows, and update the parts that have not been updated since version 0.8. Version 0.9 introduced `Window` as a component, before that `WindowDescriptor` (which would become `Window` later) was used to store information about how a window will be created. Since version 0.9, from my understanding, this information will also be synchronised with the current state of the window, and can be used to modify this state. However, some of the documentation has not been updated to reflect that, here is an example: https://docs.rs/bevy/0.8.0/bevy/window/enum.WindowMode.html / https://docs.rs/bevy/latest/bevy/window/enum.WindowMode.html (notice that the verb "Creates" is still there). This PR aims at improving the documentation relating to windows. ## Solution - Change "will" for "should" when relevant, "should" implies that the information should in both direction (from the window state to the `Window` component and vice-versa) and can be used to get and set, will implies it is only used to set a state. - Remove references to "creation" or be more clear about it. - Reference back the `Window` component for most of its sub-structs. - Clarify what needs to be clarified - A lot of other minor changes, including fixing the link to W3schools in `bevy_winit` ## Warning Please note that my knowledge about how winit and bevy_winit work is limited and some of the informations I added in the doc may be inaccurate. A person who knows better how it works should review some of my claims, in particular: - How fullscreen works: https://github.com/bevyengine/bevy/pull/8858#discussion_r1232413155 - How WindowResolution / sizes work: https://github.com/bevyengine/bevy/pull/8858#discussion_r1233010719 - What happens when `WindowPosition` is set to `Centered` or `Automatic`. From my understanding of the code, it should always be set back to `At`, but is it really the case? For example [when creating the window](https://github.com/bevyengine/bevy/blob/main/crates/bevy_winit/src/winit_windows.rs#L74), or when [a `WindowEvent::Moved` is triggered](https://github.com/bevyengine/bevy/blob/main/crates/bevy_winit/src/lib.rs#L602) or when [Centered/Automatic by the code after the window is created](https://github.com/bevyengine/bevy/blob/main/crates/bevy_winit/src/system.rs#L243), am I missing some cases and do the codes I linked do that in all of them? - Are there any field in the `Window` component that can't be used to modify the state of the window, only at creation? --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Jerome Humbert <djeedai@gmail.com> |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |