Skip to content

ParallaxScrolling

Koschi edited this page Mar 30, 2015 · 2 revisions

#summary Overview of the parallax-layer-concept

Parallax-Scrolling

Each level is designed to allow parallax-scrolling. Therefore the background-tag includes the parallax-child-tags. Each one defines a width and height and each content placed inside will be scrolled based on the position of the view inside the level. The bigger a parallax-layer is, the faster the content will be scrolled when moving the view inside the level and the closer to the viewer the content will appear to be.

The layers aligned that way, that they all line up their left borders when the view is the furthest left possible and all top borders will line up when the view is at the most top position. The lower and right borders will be aligned in a similar fashion. All other positions in between will be aligned based on the percentage of the view alignment inside the level. If the view is centred in the level, the parallax-layers will be centred as well.

To visualize the concept, see the lower image. The blue frame represents the level, the red frame represents the view and the green frames represent the parallax-layers.

Note

In order not to display empty borders on any side of the view, each layer must have at least a size as big as the maximum supported resolution of the game, which is 1920x1080.

Clone this wiki locally