Crate bevy_window

Source
Expand description

bevy_window provides a platform-agnostic interface for windowing in Bevy.

This crate contains types for window management and events, used by windowing implementors such as bevy_winit. The WindowPlugin sets up some global window-related parameters and is part of the DefaultPlugins.

Modules§

prelude
The windowing prelude.

Structs§

ClosingWindow
Marker component for a Window that has been requested to close and is in the process of closing (on the next frame).
CursorEntered
An event that is sent whenever the user’s cursor enters a window.
CursorLeft
An event that is sent whenever the user’s cursor leaves a window.
CursorMoved
An event reporting that the mouse cursor has moved inside a window.
CursorOptions
Cursor data for a Window.
EnabledButtons
Specifies which Window control buttons should be enabled.
InternalWindowState
Stores internal Window state that isn’t directly accessible.
Monitor
Represents an available monitor as reported by the user’s operating system, which can be used to query information about the display, such as its size, position, and video modes.
NormalizedWindowRef
A flattened representation of a window reference for equality/hashing purposes.
PrimaryMonitor
A marker component for the primary monitor
PrimaryWindow
Marker Component for the window considered the primary window.
RawHandleWrapper
A wrapper over RawWindowHandle and RawDisplayHandle that allows us to safely pass it across threads.
RawHandleWrapperHolder
Holder of the RawHandleWrapper with wrappers, to allow use in asynchronous context
RequestRedraw
An event that indicates all of the application’s windows should be redrawn, even if their control flow is set to Wait and there have been no window events.
ThreadLockedRawWindowHandleWrapper
A RawHandleWrapper that cannot be sent across threads.
VideoMode
Represents a video mode that a monitor supports
Window
The defining Component for window entities, storing information about how it should appear and behave.
WindowBackendScaleFactorChanged
An event that indicates a window’s OS-reported scale factor has changed.
WindowCloseRequested
An event that is sent whenever the operating systems requests that a window be closed. This will be sent when the close button of the window is pressed.
WindowClosed
An event that is sent whenever a window is closed. This will be sent when the window entity loses its Window component or is despawned.
WindowClosing
An event that is sent whenever a window is closing. This will be sent when after a WindowCloseRequested event is received and the window is in the process of closing.
WindowCreated
An event that is sent whenever a new window is created.
WindowDestroyed
An event that is sent whenever a window is destroyed by the underlying window system.
WindowFocused
An event that indicates a window has received or lost focus.
WindowMoved
An event that is sent when a window is repositioned in physical pixels.
WindowOccluded
The window has been occluded (completely hidden from view).
WindowPlugin
A Plugin that defines an interface for windowing support in Bevy.
WindowResizeConstraints
The size limits on a Window.
WindowResized
A window event that is sent whenever a window’s logical size has changed.
WindowResolution
Controls the size of a Window
WindowScaleFactorChanged
An event that indicates a window’s scale factor has changed.
WindowThemeChanged
An event sent when the system theme changes for a window.
WindowWrapper
A wrapper over a window.

Enums§

AppLifecycle
Application lifetime events
CompositeAlphaMode
Specifies how the alpha channel of the textures should be handled during compositing, for a Window.
CursorGrabMode
Defines if and how the cursor is grabbed by a Window.
ExitCondition
Defines the specific conditions the application should exit on
FileDragAndDrop
Events related to files being dragged and dropped on a window.
Ime
A Input Method Editor event.
MonitorSelection
References a screen monitor.
PresentMode
Presentation mode for a Window.
SystemCursorIcon
The icon to display for a window.
WindowEvent
Wraps all bevy_window and bevy_input events in a common enum.
WindowLevel
Specifies where a Window should appear relative to other overlapping windows (on top or under) .
WindowMode
Defines the way a Window is displayed.
WindowPosition
Defines where a Window should be placed on the screen.
WindowRef
Reference to a Window, whether it be a direct link to a specific entity or a more vague defaulting choice.
WindowTheme
The Window theme variant to use.

Functions§

close_when_requested
Close windows in response to WindowCloseRequested (e.g. when the close button is pressed).
exit_on_all_closed
Exit the application when there are no open windows.
exit_on_primary_closed
Exit the application when the primary window has been closed