bevy/examples/2d
Rob Parrett 1d5388eded
Un-hardcode positions and colors in 2d_shapes example (#11867)
# Objective

We recently got some neat new 2d shapes and the shapes are no longer
centered on the screen.

The hardcoded positions and colors are a pain to deal with when a new
shape is added.

## Solution

Delete a bunch of code and position shapes evenly. Assign colors evenly
too.

## Before

<img width="1280" alt="Screenshot 2024-02-14 at 3 17 40 PM"
src="https://github.com/bevyengine/bevy/assets/200550/cc9fd9a8-4019-4907-a50e-621cb656c20a">

## After

<img width="1280" alt="Screenshot 2024-02-14 at 3 17 24 PM"
src="https://github.com/bevyengine/bevy/assets/200550/033a3f91-d3bc-4ec8-af59-42a221f8b8e7">

---------

Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
2024-02-14 23:36:18 +00:00
..
2d_gizmos.rs Dedicated primitive example (#11697) 2024-02-14 16:55:44 +00:00
2d_shapes.rs Un-hardcode positions and colors in 2d_shapes example (#11867) 2024-02-14 23:36:18 +00:00
2d_viewport_to_world.rs Add example for Camera::viewport_to_world (#7179) 2023-09-11 18:52:11 +00:00
bloom_2d.rs Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
bounding_2d.rs Add example for bounding volumes and intersection tests (#11666) 2024-02-03 17:11:01 +00:00
custom_gltf_vertex_attribute.rs Reorder impl to be the same as the trait (#11076) 2023-12-24 17:43:55 +00:00
mesh2d.rs Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
mesh2d_manual.rs Mesh insert indices (#11745) 2024-02-06 23:31:48 +00:00
mesh2d_vertex_color_texture.rs Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
move_sprite.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
pixel_grid_snap.rs Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
rotation.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
sprite.rs Update color and naming for consistency (#10367) 2023-11-04 02:09:23 +00:00
sprite_flipping.rs Update color and naming for consistency (#10367) 2023-11-04 02:09:23 +00:00
sprite_sheet.rs Call a TextureAtlasLayout a layout and not an atlas (#11783) 2024-02-13 16:08:03 +00:00
sprite_slice.rs Optional ImageScaleMode (#11780) 2024-02-09 20:36:32 +00:00
sprite_tile.rs Optional ImageScaleMode (#11780) 2024-02-09 20:36:32 +00:00
text2d.rs Rename TextAlignment to JustifyText. (#10854) 2023-12-05 03:00:41 +00:00
texture_atlas.rs Call a TextureAtlasLayout a layout and not an atlas (#11783) 2024-02-13 16:08:03 +00:00
transparency_2d.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00