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

Use Required components #265

Merged
merged 18 commits into from
Dec 11, 2024
Merged

Use Required components #265

merged 18 commits into from
Dec 11, 2024

Conversation

Nilirad
Copy link
Owner

@Nilirad Nilirad commented Dec 9, 2024

Migrates to Bevy's Required Components.

The Path component has been renamed to Shape, which now includes data from Fill and Stroke (they are no longer components). ShapeBundle is now deprecated.

To build the Shape, a ShapeBuilder is provided, which prevents building a shape without fill and stroke at compile time, by using an inermediary type ReadyShapeBuilder. These changes made GeometryBuilder and ShapePath redundant, which have been removed.

Fill and stroke methods are now included as builder methods of ShapeBuilder and PathBuilder.

PathBuilder's methods now return Self, allowing method chaining.

Further work

I would like to expand the capabilities of ShapeBuilder in order to remove the need for PathBuilder. This will reduce the API duplication, and provide one way to do everything. I would have liked to do it in this PR, but I realized it required too much work.

Given that a lot of things have changed, I also would like to reorganize the crate's modules, and check the documentation as a whole.

`Path` will be the "driving concept" component
for Required Components.
The name does not fit well, so I changed it to `Shape`.
- Added `fill` and `stroke` fields
- Added `fill` and `stroke` setters
- Improved builder pattern by returning `Self` in methods
`ShapePath` is no longer functional
after including fill and stroke data into `Shape`.

Use `ShapeBuilder` or `PathBuilder` instead.
@Nilirad Nilirad force-pushed the required-components branch from 8b5a61b to 6da5609 Compare December 11, 2024 09:32
@Nilirad Nilirad marked this pull request as ready for review December 11, 2024 09:45
@Nilirad Nilirad merged commit 7dd478c into master Dec 11, 2024
3 checks passed
@Nilirad Nilirad deleted the required-components branch December 11, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant