bevy/examples/ui
Joona Aalto 0166db33f7
Deprecate shapes in bevy_render::mesh::shape (#11773)
# Objective

#11431 and #11688 implemented meshing support for Bevy's new geometric
primitives. The next step is to deprecate the shapes in
`bevy_render::mesh::shape` and to later remove them completely for 0.14.

## Solution

Deprecate the shapes and reduce code duplication by utilizing the
primitive meshing API for the old shapes where possible.

Note that some shapes have behavior that can't be exactly reproduced
with the new primitives yet:

- `Box` is more of an AABB with min/max extents
- `Plane` supports a subdivision count
- `Quad` has a `flipped` property

These types have not been changed to utilize the new primitives yet.

---

## Changelog

- Deprecated all shapes in `bevy_render::mesh::shape`
- Changed all examples to use new primitives for meshing

## Migration Guide

Bevy has previously used rendering-specific types like `UVSphere` and
`Quad` for primitive mesh shapes. These have now been deprecated to use
the geometric primitives newly introduced in version 0.13.

Some examples:

```rust
let before = meshes.add(shape::Box::new(5.0, 0.15, 5.0));
let after = meshes.add(Cuboid::new(5.0, 0.15, 5.0));

let before = meshes.add(shape::Quad::default());
let after = meshes.add(Rectangle::default());

let before = meshes.add(shape::Plane::from_size(5.0));
// The surface normal can now also be specified when using `new`
let after = meshes.add(Plane3d::default().mesh().size(5.0, 5.0));

let before = meshes.add(
    Mesh::try_from(shape::Icosphere {
        radius: 0.5,
        subdivisions: 5,
    })
    .unwrap(),
);
let after = meshes.add(Sphere::new(0.5).mesh().ico(5).unwrap());
```
2024-02-08 18:01:34 +00:00
..
borders.rs UI node outlines (#9931) 2023-10-05 12:10:32 +00:00
button.rs Add [lints] table, fix adding #![allow(clippy::type_complexity)] everywhere (#10011) 2023-11-18 20:58:48 +00:00
display_and_visibility.rs Rename TextAlignment to JustifyText. (#10854) 2023-12-05 03:00:41 +00:00
flex_layout.rs UI examples clean up (#9479) 2023-08-23 12:49:10 +00:00
font_atlas_debug.rs Texture Atlas rework (#5103) 2024-01-16 13:59:08 +00:00
grid.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
overflow.rs Make clipped areas of UI nodes non-interactive (#10454) 2023-11-22 14:30:38 +00:00
overflow_debug.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
relative_cursor_position.rs Camera-driven UI (#10559) 2024-01-16 00:39:10 +00:00
render_ui_to_texture.rs Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
size_constraints.rs Deprecated Various Component Methods from Query and QueryState (#9920) 2024-02-04 01:01:59 +00:00
text.rs Replace DiagnosticId by DiagnosticPath (#9266) 2024-01-20 15:42:51 +00:00
text_debug.rs Replace DiagnosticId by DiagnosticPath (#9266) 2024-01-20 15:42:51 +00:00
text_wrap_debug.rs Fix panic in examples using argh on the web (#11513) 2024-01-24 21:16:10 +00:00
transparency_ui.rs Have a separate implicit viewport node per root node + make viewport node Display::Grid (#9637) 2023-09-19 15:14:46 +00:00
ui.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
ui_material.rs Explicit color conversion methods (#10321) 2023-11-15 16:47:32 +00:00
ui_scaling.rs Update glam, encase and hexasphere (#11082) 2024-01-08 22:58:45 +00:00
ui_texture_atlas.rs Texture Atlas rework (#5103) 2024-01-16 13:59:08 +00:00
ui_texture_slice.rs UI Texture 9 slice (#11600) 2024-02-07 20:07:53 +00:00
viewport_debug.rs Use default resolution for viewport_debug example (#9666) 2023-09-02 18:43:56 +00:00
window_fallthrough.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
z_index.rs Have a separate implicit viewport node per root node + make viewport node Display::Grid (#9637) 2023-09-19 15:14:46 +00:00