Parallax - Different Layers

Aug 22, 2012 at 2:37 AM

I'm looking to create an xTile application that has multiple layers.  However, I want the layers to move independently of one another.  Examples:  Layer 0 moves left, while Layer 1 moves right (or not at all).

Is there a good way to do this?  The few examples I've seen have rely on different layer sizes to implement a parallax effect, but all layers move in the same direction.

Thanks.

Coordinator
Aug 23, 2012 at 10:03 PM

You can get one layer to not move at all by making it the same size as your viewport. As for making two layers move in opposite directions, I'm afraid you either have to load them as two single-layer maps and render them individually, or else, play around with visibility flags and render the same map twice, each time computing different viewports.

Hope that helps.