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

feat: World bounds for a CameraComponent #1605

Merged
merged 14 commits into from
May 8, 2022

Conversation

st-pasha
Copy link
Contributor

@st-pasha st-pasha commented May 5, 2022

Description

  • Add BoundedPositionBehavior which could restrict the movement of another component.
  • Use that behavior to implement camera's "world bounds". The shape of this world bound can be arbitrary.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples.

Breaking Change

  • [-] Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

Closes #812

@st-pasha st-pasha marked this pull request as ready for review May 6, 2022 18:09
Comment on lines +58 to +61
assert(
parent is PositionProvider,
'Can only apply this behavior to a PositionProvider',
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the ParentIsA mixin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The requirement that parent must be a PositionProvider only applies in case when _target == null. If, on the other hand, target was specified explicitly in the constructor, then the parent can be any.

@spydon spydon enabled auto-merge (squash) May 8, 2022 18:31
@spydon spydon merged commit abb497a into flame-engine:main May 8, 2022
@st-pasha st-pasha deleted the ps/bounded-position branch May 8, 2022 19:59
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.

Сircle camera movement boundaries
4 participants