Skip to content

Commit

Permalink
set is_transparent to true by default for UI bundles (#1071)
Browse files Browse the repository at this point in the history
set is_transparent to true by default for UI bundles
  • Loading branch information
mockersf authored Dec 18, 2020
1 parent d0840bd commit 18e5411
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
15 changes: 12 additions & 3 deletions crates/bevy_ui/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ impl Default for NodeBundle {
render_pipelines: RenderPipelines::from_pipelines(vec![RenderPipeline::new(
UI_PIPELINE_HANDLE.typed(),
)]),
visible: Default::default(),
visible: Visible {
is_transparent: true,
..Default::default()
},
node: Default::default(),
style: Default::default(),
material: Default::default(),
Expand Down Expand Up @@ -76,7 +79,10 @@ impl Default for ImageBundle {
style: Default::default(),
material: Default::default(),
draw: Default::default(),
visible: Default::default(),
visible: Visible {
is_transparent: true,
..Default::default()
},
transform: Default::default(),
global_transform: Default::default(),
}
Expand Down Expand Up @@ -147,7 +153,10 @@ impl Default for ButtonBundle {
style: Default::default(),
material: Default::default(),
draw: Default::default(),
visible: Default::default(),
visible: Visible {
is_transparent: true,
..Default::default()
},
transform: Default::default(),
global_transform: Default::default(),
}
Expand Down
2 changes: 1 addition & 1 deletion examples/asset/custom_asset_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() {
// asset system are initialized correctly.
group.add_before::<bevy::asset::AssetPlugin, _>(CustomAssetIoPlugin)
})
.add_startup_system(setup)
.add_startup_system(setup.system())
.run();
}

Expand Down
11 changes: 4 additions & 7 deletions examples/tools/bevymark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,13 @@ fn mouse_handler(
let bird_y = (window.height / 2.) - HALF_BIRD_SIZE;

for count in 0..spawn_count {
let bird_position = Vec3::new(bird_x, bird_y, (counter.count + count) as f32 * 0.00001);
let mut transform = Transform::from_translation(bird_position);
transform.scale = Vec3::new(BIRD_SCALE, BIRD_SCALE, BIRD_SCALE);

let bird_z = (counter.count + count) as f32 * 0.00001;
commands
.spawn(SpriteBundle {
material: bird_material.0.clone(),
transform,
visible: Visible {
is_transparent: true,
transform: Transform {
translation: Vec3::new(bird_x, bird_y, bird_z),
scale: Vec3::splat(BIRD_SCALE),
..Default::default()
},
..Default::default()
Expand Down
16 changes: 0 additions & 16 deletions examples/ui/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ fn setup(
..Default::default()
},
material: materials.add(Color::NONE.into()),
visible: Visible {
is_transparent: true,
..Default::default()
},
..Default::default()
})
.with_children(|parent| {
Expand Down Expand Up @@ -188,10 +184,6 @@ fn setup(
..Default::default()
},
material: materials.add(Color::rgba(1.0, 0.9, 0.9, 0.4).into()),
visible: Visible {
is_transparent: true,
..Default::default()
},
..Default::default()
});
});
Expand All @@ -206,10 +198,6 @@ fn setup(
..Default::default()
},
material: materials.add(Color::NONE.into()),
visible: Visible {
is_transparent: true,
..Default::default()
},
..Default::default()
})
.with_children(|parent| {
Expand All @@ -221,10 +209,6 @@ fn setup(
},
material: materials
.add(asset_server.load("branding/bevy_logo_dark_big.png").into()),
visible: Visible {
is_transparent: true,
..Default::default()
},
..Default::default()
});
});
Expand Down

0 comments on commit 18e5411

Please sign in to comment.