bevy/examples/2d
Daniel McNab b731ebad1b Allow closing windows at runtime (#3575)
# Objective

Fixes #3180, builds from https://github.com/bevyengine/bevy/pull/2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy:🪟:close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy:🪟:close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
2022-05-05 13:35:43 +00:00
..
mesh2d.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
mesh2d_manual.rs Add support for vertex colors (#4528) 2022-05-05 00:46:32 +00:00
move_sprite.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
rotation.rs Allow closing windows at runtime (#3575) 2022-05-05 13:35:43 +00:00
shapes.rs Add RegularPolygon and Circle meshes (#3730) 2022-05-05 00:03:47 +00:00
sprite.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
sprite_flipping.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
sprite_sheet.rs bevy_derive: Add derives for Deref and DerefMut (#4328) 2022-03-29 02:10:06 +00:00
text2d.rs Move Size to bevy_ui (#4285) 2022-04-25 13:54:46 +00:00
texture_atlas.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00