bevy/examples/asset
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
..
files Add example for using .meta files (#12882) 2024-04-08 17:10:56 +00:00
processing bevy_asset: Improve NestedLoader API (#15509) 2024-10-01 14:14:04 +00:00
alter_mesh.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
alter_sprite.rs Remove the Component trait implementation from Handle (#15796) 2024-10-09 21:10:01 +00:00
asset_decompression.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
asset_loading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
asset_settings.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
custom_asset.rs Cleanup unneeded lifetimes in bevy_asset (#15546) 2024-09-30 21:54:59 +00:00
custom_asset_reader.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
embedded_asset.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
extra_source.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
hot_asset_reloading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
multi_asset_sync.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
repeated_texture.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00