-
Notifications
You must be signed in to change notification settings - Fork 88
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`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
force-pushed
the
required-components
branch
from
December 11, 2024 09:32
8b5a61b
to
6da5609
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migrates to Bevy's Required Components.
The
Path
component has been renamed toShape
, which now includes data fromFill
andStroke
(they are no longer components).ShapeBundle
is now deprecated.To build the
Shape
, aShapeBuilder
is provided, which prevents building a shape without fill and stroke at compile time, by using an inermediary typeReadyShapeBuilder
. These changes madeGeometryBuilder
andShapePath
redundant, which have been removed.Fill and stroke methods are now included as builder methods of
ShapeBuilder
andPathBuilder
.PathBuilder
's methods now returnSelf
, allowing method chaining.Further work
I would like to expand the capabilities of
ShapeBuilder
in order to remove the need forPathBuilder
. 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.