-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add Parallax Origin property to Map Properties #3209
Conversation
Rather than "parallax offset", which to me suggests the calculated draw offset based on parallax, I think the property should be called something like "parallax origin" or something else that suggests that it's a reference point. |
* Avoid the need to negate the origin value, which probably made sense when it was still called an "offset", but as an "origin" I think it should refer to a point on the map. * Update the layer positions immediately when the parallax origin is changed.
I've changed the parallax origin to get subtracted, rather than added, to the view center. It seemed more intuitive to me, since I interpret the parallax origin to be a point on the map. Does that make sense? I've also fixed the immediate updating of the layer positions when you change the property, by connecting the The change looks fine to me now, but before we merge this we need to again update the documentation:
|
Commit to be squashed.
I think I covered it all. I did not test all exports yet as I am waiting for some additional feedback on whether the origin behaves as expected - I do not trust my own sanity checks alone. |
To be squashed.
To be squashed.
That should be all, I think. Please have a final look. |
* Tried to make the documentation a little more clear. * Added version to JSON format docs. * Simplified code in VariantToMapConverter::toMap.
Independent from the plans for viewports, giving the user means to change the parallax offset (as in a "starting position") would help greatly to accommodate differences between Tiled's approach and that of a user's game project.
Please note that this is still WIP; the PR was created for enabling discussion (and bug fixing).