-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
When I first tested this, I expected hiding a parent entity to also hide its children. This would be a useful behavior: an example would be making a rudimentary state system by having each state be represented by a root entity, and hiding the root entity of inactive states so the entire states aren't visible.
Below is a minimal example of a child still being visible after the parent is hidden, using bevy 0.3.0.
use bevy::prelude::*;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.run();
}
fn setup(
mut commands: Commands,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
commands
.spawn(Camera2dComponents::default())
.spawn(())
.with(Draw {
is_visible: false,
..Default::default()
})
.with_children(|parent| {
parent.spawn(SpriteComponents {
material: materials.add(Color::BLUE.into()),
sprite: Sprite::new(Vec2::new(50.0, 50.0)),
..Default::default()
});
});
}memoryruins, razaamir, Sheepyhead, anthonyarusso, jtran and 3 more
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
