This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

Background Images

From SuperTux
Jump to: navigation, search

With levels that can vary in size both horizontally and vertically comes the need for background images that have the same property. This however causes problems with images that show, for example, a sky; we don't want it to repeat below the ground.

We have three solutions for this.

The first is to divide images into three rows. All of these are tilable horizontally (like the milestone 1 backgrounds). Additionally, the top and bottom rows are also tilable vertically. Thus, the middle part of the image has a fixed vertical size while the top and bottom are variable.

Second, we create background images out of tilemaps. These can scroll at different rates than the main frame, but the level author can ensure that the tilemaps are big enough.

Finally, we can anchor images to a portion of the screen so that vertical movement doesn't affect the image.