Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Run cargo test
run: cargo test

Expand All @@ -59,7 +59,7 @@ jobs:
with:
components: clippy
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Run clippy
run: cargo clippy -- -D warnings

Expand Down
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ license = "MIT OR Apache-2.0"
name = "bevy_prototype_lyon"
readme = "README.md"
repository = "https://github.com/rparrett/bevy_prototype_lyon/"
version = "0.14.1"
version = "0.15.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = { version = "0.16", default-features = false, features = [
bevy = { version = "0.17", default-features = false, features = [
"bevy_asset",
"bevy_core_pipeline",
"bevy_log",
"bevy_render",
"bevy_sprite",
"bevy_sprite_render",
] }
lyon_tessellation = "1"
lyon_algorithms = "1"
svgtypes = "0.15"

[dev-dependencies]
bevy = "0.16"
bevy = "0.17"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The following table shows the latest version of `bevy_prototype_lyon` that suppo

|bevy|bevy_prototype_lyon|license|
|---|---|---|
|0.17|0.15|MIT/Apache 2.0|
|0.16|0.14|MIT/Apache 2.0|
|0.15|0.13|MIT/Apache 2.0|
|0.14|0.12|MIT/Apache 2.0|
Expand Down
10 changes: 6 additions & 4 deletions examples/dynamic_stroke_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ fn setup_system(mut commands: Commands) {
Transform::default().with_translation(Vec3::new(0.0, 0.0, 1.0)),
HexagonShape,
));
commands.spawn((ShapeBuilder::with(&big_square)
.fill(ORANGE)
.stroke((BLACK, 10.0))
.build(),));
commands.spawn(
ShapeBuilder::with(&big_square)
.fill(ORANGE)
.stroke((BLACK, 10.0))
.build(),
);
}
25 changes: 0 additions & 25 deletions src/entity.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Custom Bevy ECS bundle for shapes.
#![expect(deprecated)]

use bevy::prelude::*;
use lyon_algorithms::path::Builder;
Expand All @@ -11,30 +10,6 @@ use crate::{
plugin::COLOR_MATERIAL_HANDLE,
};

/// A Bevy `Bundle` to represent a shape.
#[deprecated(since = "0.14.0", note = "please use the `Shape` component instead.")]
#[allow(missing_docs)]
#[derive(Bundle, Clone)]
pub struct ShapeBundle {
pub path: Shape,
pub mesh: Mesh2d,
pub material: MeshMaterial2d<ColorMaterial>,
pub transform: Transform,
pub visibility: Visibility,
}

impl Default for ShapeBundle {
fn default() -> Self {
Self {
path: default(),
mesh: default(),
material: MeshMaterial2d(COLOR_MATERIAL_HANDLE),
transform: default(),
visibility: default(),
}
}
}

/// `Component` describing a geometric shape.
///
/// It can be constructed using `ShapeBuilder`.
Expand Down
20 changes: 12 additions & 8 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
//! boilerplate.

use bevy::{
asset::weak_handle,
asset::{RenderAssetUsages, uuid_handle},
mesh::Indices,
prelude::*,
render::{mesh::Indices, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology},
render::render_resource::PrimitiveTopology,
};
use lyon_tessellation::{self as tess, BuffersBuilder};

Expand All @@ -17,7 +18,7 @@ use crate::{
};

pub(crate) const COLOR_MATERIAL_HANDLE: Handle<ColorMaterial> =
weak_handle!("7cc661a1-0cd6-c147-129a-2c01882d9580");
uuid_handle!("7cc661a1-0cd6-c147-129a-2c01882d9580");

/// A plugin that provides resources and a system to draw shapes in Bevy with
/// less boilerplate.
Expand All @@ -32,20 +33,23 @@ impl Plugin for ShapePlugin {
.configure_sets(
PostUpdate,
BuildShapes
.after(bevy::transform::TransformSystem::TransformPropagate)
.before(bevy::asset::AssetEvents),
.after(bevy::transform::TransformSystems::Propagate)
.before(bevy::asset::AssetEventSystems),
)
.add_systems(PostUpdate, mesh_shapes_system.in_set(BuildShapes));

app.world_mut()
.resource_mut::<Assets<ColorMaterial>>()
.insert(
if let Some(mut materials) = app.world_mut().get_resource_mut::<Assets<ColorMaterial>>() {
// `insert` will not fail for uuid assets
let _ = materials.insert(
&COLOR_MATERIAL_HANDLE,
ColorMaterial {
color: Color::WHITE,
..default()
},
);
} else {
error!("Failed to get Assets<ColorMaterial> resource");
}
}
}

Expand Down