Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 0.11 #235

Merged
merged 2 commits into from
Feb 19, 2024
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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
## 0.9.0
- Support for Bevy 0.11.

## 0.11.0
- Support for Bevy 0.13

## 0.10.0
- Support for Bevy 0.12

## 0.9.0
- `ShapeBundle` now contains the `spatial: SpatialBundle` field,
which bundles together
`Transform`,
`GlobalTransform`,
`Visibility`
and `InheritedVisibility`.

## 0.8.0
- Support for Bevy 0.10.
- Uses original render.
Expand Down
14 changes: 11 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ license = "MIT OR Apache-2.0"
name = "bevy_prototype_lyon"
readme = "README.md"
repository = "https://github.com/Nilirad/bevy_prototype_lyon/"
version = "0.10.0"
version = "0.11.0"

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

[dependencies]
bevy = { version = "0.12", default-features = false, features = ["bevy_sprite", "bevy_render", "bevy_core_pipeline", "bevy_asset"] }
bevy = { version = "0.13", default-features = false, features = [
"bevy_sprite",
"bevy_render",
"bevy_core_pipeline",
"bevy_asset",
] }
lyon_tessellation = "1"
lyon_algorithms = "1"
svgtypes = "0.12"

[dev-dependencies]
bevy = { version = "0.12", default-features = false, features = ["x11", "bevy_asset"] }
bevy = { version = "0.13", default-features = false, features = [
"x11",
"bevy_asset",
] }
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ I strive to support the latest version of Bevy. Support for a version of Bevy is
The following table shows the latest version of `bevy_prototype_lyon` that supports a certain version of Bevy.

|bevy|bevy_prototype_lyon|license|
|----|---|---|
|---|---|---|
|0.13|0.11|MIT/Apache 2.0|
|0.12|0.10|MIT/Apache 2.0|
|0.11|0.9|MIT/Apache 2.0|
|0.10|0.8|MIT/Apache 2.0|
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic_shape.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::f64::consts::PI;

use bevy::prelude::*;
use bevy_prototype_lyon::{entity::ShapeBundle, prelude::*};
use bevy_prototype_lyon::prelude::*;

fn main() {
App::new()
Expand Down
7 changes: 2 additions & 5 deletions examples/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ fn main() {
.run();
}

#[derive(Component)]
struct Name(String);

#[derive(Component)]
struct BlacksmithMarker;

Expand All @@ -25,7 +22,7 @@ fn setup_system(mut commands: Commands) {

commands
.spawn((
Name("Blacksmith".to_owned()),
Name::new("Blacksmith"),
BlacksmithMarker,
SpatialBundle {
transform: Transform::from_translation(Vec3::new(-50., 0., 0.)),
Expand Down Expand Up @@ -62,7 +59,7 @@ fn setup_system(mut commands: Commands) {

commands
.spawn((
Name("Shack".to_owned()),
Name::new("Shack"),
ToolShackMarker,
SpatialBundle {
transform: Transform {
Expand Down
4 changes: 2 additions & 2 deletions src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl ShapePath {
///
/// ```
/// # use bevy::prelude::*;
/// # use bevy_prototype_lyon::prelude::*;
/// # use bevy_prototype_lyon::prelude::{RegularPolygon, *};
/// #
/// # #[derive(Component)]
/// # struct Player;
Expand Down Expand Up @@ -73,7 +73,7 @@ impl ShapePath {
///
/// ```
/// # use bevy::prelude::*;
/// # use bevy_prototype_lyon::prelude::*;
/// # use bevy_prototype_lyon::prelude::{RegularPolygon, *};
/// #
/// # #[derive(Component)]
/// # struct Player;
Expand Down
9 changes: 6 additions & 3 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use bevy::{
prelude::*,
render::{mesh::Indices, render_resource::PrimitiveTopology},
render::{mesh::Indices, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology},
sprite::Mesh2dHandle,
};
use lyon_tessellation::{self as tess, BuffersBuilder};
Expand Down Expand Up @@ -127,8 +127,11 @@ fn stroke(
}

fn build_mesh(buffers: &VertexBuffers) -> Mesh {
let mut mesh = Mesh::new(PrimitiveTopology::TriangleList);
mesh.set_indices(Some(Indices::U32(buffers.indices.clone())));
let mut mesh = Mesh::new(
PrimitiveTopology::TriangleList,
RenderAssetUsages::RENDER_WORLD,
);
mesh.insert_indices(Indices::U32(buffers.indices.clone()));
mesh.insert_attribute(
Mesh::ATTRIBUTE_POSITION,
buffers
Expand Down
Loading