Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement parallax scrolling #238

Open
nightm4re94 opened this issue Mar 19, 2019 · 6 comments
Open

Implement parallax scrolling #238

nightm4re94 opened this issue Mar 19, 2019 · 6 comments
Labels
feature MAJOR This label is intended to distinguish major features from all the others. tmx our specification of the Tiled map format.

Comments

@nightm4re94
Copy link
Member

Most awesome 2D games have a parallax scrolling engine. We should support this too.
Maybe the map creator would simply set some sort of "scrollSpeed" Layer property (default: 1.0) and then all layers would be scrolled by our wizardry.

@nightm4re94 nightm4re94 added feature MAJOR This label is intended to distinguish major features from all the others. labels Mar 19, 2019
@TheRamenChef
Copy link
Collaborator

It's currently open as a feature request on the Tiled forums. We should determine whether it's worth waiting for support from Tiled, or alternatively, reach out and see if we can figure out how it will eventually be implemented in Tiled.

Parallax scrolling for tile layers could be problematic, as it would need to be taken into account when resolving tiles, and the tiles would still be the same size as the other layers.

@steffen-wilke
Copy link
Contributor

@TheRamenChef That's a nice finding. Seeing the creation date of that issue though, I don't have much hope that this will get implemented any time soon. But I totally agree on reaching out to bjorn and see what he has planned regarding this topic.

@nightm4re94
Copy link
Member Author

I can't imagine this feature being implemented in Tiled too soon either.

Regarding the calculation of tile boundaries on scrolling layers, I had in mind that the Tile grid would still persist as is, only considering the unscrolled tile layer (-> the default foreground plane). The offset of scrolled layers would be a solely visual effect, not influencing any Tile calculations.
The following image taken from Stackoverflow shows quite well what I had intended:
Parallax sample image
Tile sizes would be the same for all layers, but the scrolling layers would need to "be bigger"(cover more tiles) than the layers with default scrolling. The default layers would only cover a smaller portion of the map, depending on how big the viewport is.

There are plenty of resources on implementing a parallax scrolling effect.

@TheRamenChef
Copy link
Collaborator

Any updates on this? Have we contacted bjorn yet?

@steffen-wilke
Copy link
Contributor

No, not yet. And no other updates currently.

@nightm4re94
Copy link
Member Author

nightm4re94 commented Jul 20, 2022

This is, in fact, already a feature in Tiled:
https://doc.mapeditor.org/en/stable/manual/layers/#parallax-factor

We are still only supporting Tiled v1.2 maps - should update our map specifications urgently to the more recent versions of the tmx format.

Closing this issue in favor of #464.

@nightm4re94 nightm4re94 changed the title Add parallax scrolling capabilities for Tile and Image layers. Implement parallax scrollin Jul 20, 2022
@nightm4re94 nightm4re94 changed the title Implement parallax scrollin Implement parallax scrolling Jul 20, 2022
@steffen-wilke steffen-wilke added the tmx our specification of the Tiled map format. label Dec 28, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature MAJOR This label is intended to distinguish major features from all the others. tmx our specification of the Tiled map format.
Projects
None yet
Development

No branches or pull requests

3 participants