bevy/examples/2d
ickshonpe 6f7d0e5725
split up TextStyle (#15857)
# Objective

Currently text is recomputed unnecessarily on any changes to its color,
which is extremely expensive.

## Solution
Split up `TextStyle` into two separate components `TextFont` and
`TextColor`.

## Testing

I added this system to `many_buttons`:
```rust
fn set_text_colors_changed(mut colors: Query<&mut TextColor>) {
    for mut text_color in colors.iter_mut() {
        text_color.set_changed();
    }
}
```

reports ~4fps on main, ~50fps with this PR.

## Migration Guide
`TextStyle` has been renamed to `TextFont` and its `color` field has
been moved to a separate component named `TextColor` which newtypes
`Color`.
2024-10-13 17:06:22 +00:00
..
2d_shapes.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
2d_viewport_to_world.rs Implement From translation and rotation for isometries (#15733) 2024-10-08 16:09:28 +00:00
bloom_2d.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
bounding_2d.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
cpu_draw.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
custom_gltf_vertex_attribute.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
mesh2d.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
mesh2d_alpha_mode.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
mesh2d_arcs.rs Implement From translation and rotation for isometries (#15733) 2024-10-08 16:09:28 +00:00
mesh2d_manual.rs Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
mesh2d_vertex_color_texture.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
move_sprite.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
pixel_grid_snap.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
rotation.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
sprite.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
sprite_animation.rs Fix sprite and picking examples (#15803) 2024-10-09 23:51:28 +00:00
sprite_flipping.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
sprite_sheet.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
sprite_slice.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
sprite_tile.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
text2d.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
texture_atlas.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
transparency_2d.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
wireframe_2d.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00