Infinite Scroller / Getting Started

Infinite Scroller can be found in the Assets/Playniax/Framework/Prototyping/Infinite Scroller/Examples folder.

Setup

You first need to create a GameObject and add the Scroller.cs component.

The Scroller determines the world size and handles the scrolling.

After this you can add the layers.

This can be a TileLayer.cs or ObjectsLayer.cs component.

To do this again create a GameObject and add the components to the GameObjects.

A scroller with a TileLayer might look something like this:



Besides a TileLayer you can also add an ObjectsLayer.

Most common used objects are sprites.

The ObjectsLayer must be a GameObject with the ObjectsLayer component attached to it.

Make sure these ObjectsLayers are children of the Scroller.

Once a ObjectsLayer is created you can add sprites to them.

Make sure each sprite has the LayerRenderer component attached to it as well.

This setup might look something like this:

The Sprite Randomizer

The Sprite Randomizer is a great tool to create random backgrounds or objects.

You just need to tell it what sprites to use and it will create the objects automatically making sure they don't overlap.

Just attach the SpriteRandomizer.cs component to the GameObject that has the ObjectsLayer and it will do they rest:



A better detailed description of the classes can be found in the Classes section.