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: Adding ClipComponent #1769

Merged
merged 18 commits into from
Sep 13, 2022
Merged

feat: Adding ClipComponent #1769

merged 18 commits into from
Sep 13, 2022

Conversation

erickzanardo
Copy link
Member

Description

Adds a new component called ClipComponent that clips the canvas area based on its size and shape.

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

@erickzanardo erickzanardo requested review from st-pasha and a team July 1, 2022 16:41
Copy link
Member

@spydon spydon 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! Just some small grammar stuff.

doc/flame/components.md Outdated Show resolved Hide resolved
doc/flame/components.md Outdated Show resolved Hide resolved
doc/flame/components.md Outdated Show resolved Hide resolved
examples/lib/stories/components/components.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
@st-pasha
Copy link
Contributor

st-pasha commented Jul 1, 2022

Related issue: #1274

erickzanardo and others added 2 commits July 1, 2022 14:07
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
doc/flame/components.md Outdated Show resolved Hide resolved
doc/flame/components.md Outdated Show resolved Hide resolved
Copy link
Member

@renancaraujo renancaraujo left a comment

Choose a reason for hiding this comment

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

I like the idea and the implemmentation looks good.

The only thing is that it is hard to trigger a path reconstruction if after load/mount, the user requires to change the shape of the clipped area (eg: update the size of the clipped rectangle given a game constraint)

@erickzanardo

This comment was marked as outdated.

@st-pasha

This comment was marked as outdated.

@erickzanardo

This comment was marked as outdated.

@erickzanardo erickzanardo requested review from st-pasha, alestiago and renancaraujo and removed request for alestiago September 5, 2022 20:12
@erickzanardo erickzanardo requested review from spydon and removed request for alestiago September 5, 2022 20:13
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Just some small grammar stuff otherwise lgtm!

doc/flame/components.md Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@alestiago alestiago left a comment

Choose a reason for hiding this comment

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

Looking way better!

packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
doc/flame/components.md Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/clip_component.dart Outdated Show resolved Hide resolved

Shape _buildShape();

void _prepare() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be public, allowing the shape to be modified by an external force (such as an effect or a tap callback).

@spydon spydon changed the title feat: adding ClipComponent feat: Adding ClipComponent Sep 11, 2022
@spydon spydon enabled auto-merge (squash) September 13, 2022 12:46
@spydon spydon merged commit f34d86d into main Sep 13, 2022
@spydon spydon deleted the erick.clip-component branch September 13, 2022 12:52
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.

6 participants