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

Un-hardcode positions and colors in 2d_shapes example #11867

Merged
merged 6 commits into from
Feb 14, 2024

Conversation

rparrett
Copy link
Contributor

Objective

We recently got some neat new 2d shapes and the shapes are no longer centered on the screen.

The hardcoded positions and colors are a pain to deal with when a new shape is added.

Solution

Delete a bunch of code and position shapes evenly. Assign colors evenly too.

Before

Screenshot 2024-02-14 at 3 17 40 PM

After

Screenshot 2024-02-14 at 3 17 24 PM

@rparrett rparrett changed the title Un-hardcode 2d shape positions and colors Un-hardcode 2d shape positions and colors in 2d_shapes example Feb 14, 2024
@rparrett rparrett changed the title Un-hardcode 2d shape positions and colors in 2d_shapes example Un-hardcode positions and colors in 2d_shapes example Feb 14, 2024
@rparrett rparrett added C-Examples An addition or correction to our examples C-Code-Quality A section of code that is hard to understand or change labels Feb 14, 2024
@alice-i-cecile alice-i-cecile added the A-Math Fundamental domain-agnostic mathematical operations label Feb 14, 2024
Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, especially the color changes! I just suggested a few places where comments might be appreciated (non-blocking, though). Feel free to reword them however you like.

examples/2d/2d_shapes.rs Show resolved Hide resolved
examples/2d/2d_shapes.rs Show resolved Hide resolved
rparrett and others added 2 commits February 14, 2024 15:39
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
Copy link
Contributor

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a tiny non-blocking suggestion

examples/2d/2d_shapes.rs Outdated Show resolved Hide resolved
@Jondolf Jondolf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 14, 2024
Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
examples/2d/2d_shapes.rs Outdated Show resolved Hide resolved
Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 14, 2024
Merged via the queue into bevyengine:main with commit 1d5388e Feb 14, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Code-Quality A section of code that is hard to understand or change C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants