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: Introduce the FixedResolutionViewport #2796

Merged
merged 23 commits into from
Oct 9, 2023

Conversation

spydon
Copy link
Member

@spydon spydon commented Oct 4, 2023

Description

This enables you to zoom when using the CameraComponent.withFixedResolution constructor, without disabling the fixed resolution after doing so, by introducing a new viewport the FixedResolutionViewport.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • 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 or docs.

Breaking Change?

  • No, this PR is not a breaking change.

Maybe slightly breaking for the people that have done work-arounds.

Related Issues

Closes #2776

@ufrshubham
Copy link
Collaborator

Reposting here:
Components attached to viewfinder look correct now. They work like HUD and maintain their scale and position w.r.t to the virual resolution as expected. But the gesture events seem wrong. In the following video you can see that the pause button detects tap events assuming the button to be in the world space.

HudButton.mp4

@spydon spydon marked this pull request as draft October 6, 2023 21:17
@spydon
Copy link
Member Author

spydon commented Oct 7, 2023

This has shown quite tricky to get clean code for, so I'm turning it to a draft.
I'm currently experimenting with introducing a Lens beside the Viewfinder and Viewport.

@spydon spydon force-pushed the spydon/proper-fixed-resolution-viewport branch from e53d419 to adf5a95 Compare October 9, 2023 18:35
@spydon spydon changed the title fix: Properly handle zoom in CameraComponent.withFixedResolution feat: Introduce the FixedResolutionViewport Oct 9, 2023
@spydon spydon marked this pull request as ready for review October 9, 2023 21:32
Copy link
Member

@luanpotter luanpotter left a comment

Choose a reason for hiding this comment

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

😍

@spydon spydon merged commit 4c762f9 into main Oct 9, 2023
8 checks passed
@spydon spydon deleted the spydon/proper-fixed-resolution-viewport branch October 9, 2023 22:20
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.

FixedResolutionViewport on the new CameraComponent API
4 participants