bevy/crates
mwbryant 8b5bf42c28
UI texture atlas support (#8822)
# Objective

This adds support for using texture atlas sprites in UI. From
discussions today in the ui-dev discord it seems this is a much wanted
feature.

This was previously attempted in #5070 by @ManevilleF however that was
blocked #5103. This work can be easily modified to support #5103 changes
after that merges.

## Solution

I created a new UI bundle that reuses the existing texture atlas
infrastructure. I create a new atlas image component to prevent it from
being drawn by the existing non-UI systems and to remove unused
parameters.

In extract I added new system to calculate the required values for the
texture atlas image, this extracts into the same resource as the
existing UI Image and Text components.

This should have minimal performance impact because if texture atlas is
not present then the exact same code path is followed. Also there should
be no unintended behavior changes because without the new components the
existing systems write the extract same resulting data.

I also added an example showing the sprite working and a system to
advance the animation on space bar presses.

Naming is hard and I would accept any feedback on the bundle name! 

---

## Changelog

>  Added TextureAtlasImageBundle

---------

Co-authored-by: ickshonpe <david.curthoys@googlemail.com>
2023-06-19 21:52:02 +00:00
..
bevy_a11y Require #[derive(Event)] on all Events (#7086) 2023-06-06 14:44:32 +00:00
bevy_animation Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_app Fix documentation of SubApp extract (#8747) 2023-06-12 19:30:04 +00:00
bevy_asset Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_audio reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_core Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_core_pipeline Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_derive bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_diagnostic Initialize DiagnosticStore on register_diagnostic if it does not exist (#8819) 2023-06-12 19:40:09 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Remove stray boilerplate line in bevy_dynamic_plugin/Cargo.toml (#8830) 2023-06-12 19:10:48 +00:00
bevy_ecs Make function pointers of ecs Reflect* public (#8687) 2023-06-19 14:06:58 +00:00
bevy_ecs_compile_fail_tests Resolve clippy issues for rust 1.70.0 (#8738) 2023-06-01 21:05:05 +00:00
bevy_encase_derive update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_gilrs Add gamepad rumble support to bevy_input (#8398) 2023-04-24 15:28:53 +00:00
bevy_gizmos Instanced line rendering for gizmos based on bevy_polyline (#8427) 2023-06-13 06:49:47 +00:00
bevy_gltf Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_hierarchy Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_input Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_internal Instanced line rendering for gizmos based on bevy_polyline (#8427) 2023-06-13 06:49:47 +00:00
bevy_log Update android_log-sys requirement from 0.2.0 to 0.3.0 (#7925) 2023-06-01 07:55:33 +00:00
bevy_macro_utils update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_macros_compile_fail_tests bevy_derive: Add #[deref] attribute (#8552) 2023-05-16 18:29:09 +00:00
bevy_math Add integer equivalents for Rect (#7984) 2023-06-12 19:10:48 +00:00
bevy_mikktspace update syn, encase, glam and hexasphere (#8573) 2023-05-16 01:24:17 +00:00
bevy_pbr Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_ptr Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
bevy_reflect Do not require mut on ParsedPath::element_mut (#8891) 2023-06-19 15:27:45 +00:00
bevy_reflect_compile_fail_tests reflect: stable type path v2 (#7184) 2023-06-05 20:31:20 +00:00
bevy_render Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_scene Rename Command's "write" method to "apply" (#8814) 2023-06-12 17:53:47 +00:00
bevy_sprite Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_tasks remove some use of once_cell that can be replace with new std (#8739) 2023-06-01 21:55:18 +00:00
bevy_text Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_time Hide naga info logs & Derive PartialEq on Timer and Stopwatch (#8664) 2023-05-24 15:16:15 +00:00
bevy_transform Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_ui UI texture atlas support (#8822) 2023-06-19 21:52:02 +00:00
bevy_utils Fix all_tuples + added docs. (#8743) 2023-06-02 16:05:27 +00:00
bevy_window Add FromReflect where Reflect is used (#8776) 2023-06-19 16:18:17 +00:00
bevy_winit Add window entity to mouse and keyboard events (#8852) 2023-06-16 13:54:06 +00:00