Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
80e053e
`bevy_ui::render`
ickshonpe Jul 19, 2023
977326c
Clean up and refactoring.
ickshonpe Jul 19, 2023
656c7a2
removed unneeded return
ickshonpe Jul 19, 2023
658feec
Renamed `get` method to `next_buffer`
ickshonpe Jul 19, 2023
21f7f2c
Added doc comment
ickshonpe Jul 19, 2023
3e71e45
Add iterator for ExtractedUiNodes
ickshonpe Jul 20, 2023
df19fdd
clean up
ickshonpe Jul 20, 2023
6008012
Delete commented out code
ickshonpe Jul 20, 2023
dc6b14f
cargo fmt
ickshonpe Jul 20, 2023
4550b6d
renamed `out` variables in extraction functions to `output_buffer`
ickshonpe Jul 20, 2023
23c2a05
cargo fmt
ickshonpe Jul 20, 2023
9362b30
cargo fmt --all
ickshonpe Jul 20, 2023
fa41464
use `std::mem::replace` in next function
ickshonpe Jul 20, 2023
6d00a1f
switch if condition branches
ickshonpe Jul 20, 2023
4ac35a9
`bevy_ui::render`
ickshonpe Jul 25, 2023
cbbd256
`UiStackIndex`
ickshonpe Jul 25, 2023
d26b2db
Merge branch 'stack-index-component' into extracted-ui-index-with-sta…
ickshonpe Jul 25, 2023
c3a1716
Removed unused `UiStack` parameters
ickshonpe Jul 25, 2023
e873331
cargo fmt
ickshonpe Jul 25, 2023
2694777
`bevy_ui::render`
ickshonpe Jul 25, 2023
80d010a
`bevy_ui::render`
ickshonpe Jul 25, 2023
17e0233
use `push_multiple` for text and border ui extractions
ickshonpe Jul 25, 2023
091450f
`bevy_ui::render`
ickshonpe Jul 26, 2023
e44278e
Added more doc comments.
ickshonpe Jul 26, 2023
bfcab76
Merge branch 'extracted-ui-spans' into ui-ordered-extraction
ickshonpe Jul 26, 2023
fbeffc2
complete merge
ickshonpe Jul 26, 2023
a122eef
cargo fmt --all
ickshonpe Jul 26, 2023
923b53b
`bevy_ui_node::UiStackIndex`:
ickshonpe Aug 9, 2023
30d4c0e
Added doc comments for `UiStackIndex`
ickshonpe Aug 9, 2023
53cdbfd
Merge branch 'main' into ui-ordered-extraction
ickshonpe Aug 9, 2023
a16b627
fix merge
ickshonpe Aug 9, 2023
1f2a333
doc comments fix
ickshonpe Aug 9, 2023
4def556
Fixed doc comments for UI node bundles, replacing `field` with `compo…
ickshonpe Aug 9, 2023
f223fc7
Added links to node bundle comments
ickshonpe Aug 20, 2023
3e106e2
Removed double space in comments
ickshonpe Aug 20, 2023
aefe205
Removed doc comment links to private items.
ickshonpe Aug 20, 2023
d389725
Merge branch 'main' into ui-ordered-extraction
ickshonpe Aug 21, 2023
a0eb2bd
fixed `text_ui_stack_system`
ickshonpe Aug 21, 2023
7194fc0
cargo fmt
ickshonpe Aug 21, 2023
64bc7c6
Removed unused import
ickshonpe Aug 22, 2023
1f476cb
Fixed UI batching so new batches aren't created for untextured nodes.
ickshonpe Aug 28, 2023
6891a81
cargo fmt --all
ickshonpe Aug 28, 2023
4196697
Fixed panic, can't just unwrap the last element from batches to chang…
ickshonpe Aug 28, 2023
828d57b
Merge branch 'main' into ui-ordered-extraction
ickshonpe Aug 28, 2023
c6a9cd6
removed unused imports
ickshonpe Aug 28, 2023
4e66610
Reworked extraction to avoid the sparseset
ickshonpe Aug 29, 2023
9af14cc
Merge branch 'ui-batching-fix' into merge-ui-extracted-ranges-vec-and…
ickshonpe Aug 29, 2023
68b0794
Removed unused.
ickshonpe Aug 29, 2023
c26fc59
removed commented out line
ickshonpe Aug 29, 2023
cc570e5
removed `queue_uinodes` function
ickshonpe Aug 29, 2023
183fb5c
Added a background image to some of the buttons in the `many_buttons`…
ickshonpe Aug 29, 2023
0def05b
Added an image to some of the buttons in the `many_buttons` example.
ickshonpe Aug 29, 2023
0e535a1
cargo fmt
ickshonpe Aug 29, 2023
50f08e0
Merge branch 'many-buttons-image' into ui-extracted-range-2
ickshonpe Aug 30, 2023
d8efd21
added many_uinodes example
ickshonpe Aug 30, 2023
a921734
added many_uinodes example
ickshonpe Aug 30, 2023
4aeb0b3
updated example
ickshonpe Aug 31, 2023
42436a0
update example
ickshonpe Aug 31, 2023
7476d1b
Sort extracted nodes in queue
ickshonpe Sep 1, 2023
54bf375
use unstable sort
ickshonpe Sep 1, 2023
9d714eb
call finish() for extraction
ickshonpe Sep 1, 2023
4f68ea4
Clean up and improved `ExtractedUiNodes` interface.
ickshonpe Sep 1, 2023
d86f7b6
ci fixes
ickshonpe Sep 1, 2023
739fb5a
Merge branch 'main' into ui-extracted-range-2
ickshonpe Sep 1, 2023
eeadc8b
cargo fmt
ickshonpe Sep 1, 2023
55e5cc9
fixed example
ickshonpe Sep 1, 2023
0daa618
No need to set discriminator to 0, it's already done by clear()
ickshonpe Sep 1, 2023
f419f3d
fix for internal imports ci error
ickshonpe Sep 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,19 @@ description = "Test rendering of many UI elements"
category = "Stress Tests"
wasm = true


[[example]]
name = "many_rects"
path = "examples/stress_tests/many_rects.rs"
doc-scrape-examples = true

[package.metadata.example.many_rects]
name = "Many Rects"
description = "Benchmark to test UI rendering performance"
category = "Stress Tests"
wasm = true


[[example]]
name = "many_cubes"
path = "examples/stress_tests/many_cubes.rs"
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl Plugin for UiPlugin {
.register_type::<BorderColor>()
.register_type::<widget::Button>()
.register_type::<widget::Label>()
.register_type::<UiStackIndex>()
.register_type::<ZIndex>()
.add_systems(
PreUpdate,
Expand Down
32 changes: 30 additions & 2 deletions crates/bevy_ui/src/node_bundles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::widget::TextFlags;
use crate::{
widget::{Button, UiImageSize},
BackgroundColor, BorderColor, ContentSize, FocusPolicy, Interaction, Node, Style, UiImage,
UiTextureAtlasImage, ZIndex,
UiStackIndex, UiTextureAtlasImage, ZIndex,
};
use bevy_asset::Handle;
use bevy_ecs::bundle::Bundle;
Expand Down Expand Up @@ -52,6 +52,11 @@ pub struct NodeBundle {
pub view_visibility: ViewVisibility,
/// Indicates the depth at which the node should appear in the UI
pub z_index: ZIndex,
/// The node's position in the UiStack. Nodes with lower stack indices are drawn first.
/// Nodes with a higher stack index are drawn over nodes with a lower stack index.
///
/// This component is automatically managed by `ui_stack_system`.
pub stack_index: UiStackIndex,
}

impl Default for NodeBundle {
Expand All @@ -69,6 +74,7 @@ impl Default for NodeBundle {
inherited_visibility: Default::default(),
view_visibility: Default::default(),
z_index: Default::default(),
stack_index: Default::default(),
}
}
}
Expand Down Expand Up @@ -112,6 +118,11 @@ pub struct ImageBundle {
pub view_visibility: ViewVisibility,
/// Indicates the depth at which the node should appear in the UI
pub z_index: ZIndex,
/// The node's position in the UiStack. Nodes with lower stack indices are drawn first.
/// Nodes with a higher stack index are drawn over nodes with a lower stack index.
///
/// This component is automatically managed by `ui_stack_system`.
pub stack_index: UiStackIndex,
}

/// A UI node that is a texture atlas sprite
Expand Down Expand Up @@ -155,6 +166,11 @@ pub struct AtlasImageBundle {
pub view_visibility: ViewVisibility,
/// Indicates the depth at which the node should appear in the UI
pub z_index: ZIndex,
/// The node's position in the UiStack. Nodes with lower stack indices are drawn first.
/// Nodes with a higher stack index are drawn over nodes with a lower stack index.
///
/// This component is automatically managed by `ui_stack_system`.
pub stack_index: UiStackIndex,
}

#[cfg(feature = "bevy_text")]
Expand Down Expand Up @@ -193,7 +209,12 @@ pub struct TextBundle {
pub view_visibility: ViewVisibility,
/// Indicates the depth at which the node should appear in the UI
pub z_index: ZIndex,
/// The background color that will fill the containing node
/// The node's position in the UiStack. Nodes with lower stack indices are drawn first.
/// Nodes with a higher stack index are drawn over nodes with a lower stack index.
///
/// This component is automatically managed by `ui_stack_system`.
pub stack_index: UiStackIndex,
/// The background color that will fill the containing node
pub background_color: BackgroundColor,
}

Expand All @@ -214,6 +235,7 @@ impl Default for TextBundle {
inherited_visibility: Default::default(),
view_visibility: Default::default(),
z_index: Default::default(),
stack_index: Default::default(),
// Transparent background
background_color: BackgroundColor(Color::NONE),
}
Expand Down Expand Up @@ -307,6 +329,11 @@ pub struct ButtonBundle {
pub view_visibility: ViewVisibility,
/// Indicates the depth at which the node should appear in the UI
pub z_index: ZIndex,
/// The node's position in the UiStack. Nodes with lower stack indices are drawn first.
/// Nodes with a higher stack index are drawn over nodes with a lower stack index.
///
/// This component is automatically managed by `ui_stack_system`.
pub stack_index: UiStackIndex,
}

impl Default for ButtonBundle {
Expand All @@ -326,6 +353,7 @@ impl Default for ButtonBundle {
inherited_visibility: Default::default(),
view_visibility: Default::default(),
z_index: Default::default(),
stack_index: Default::default(),
}
}
}
Loading