MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

[Tiled] Add Parallax Factor in TiledMapLayer (New in Tiled 1.5)

Open fossegutten opened this issue 3 years ago • 1 comments

Add a Vector2 property for the new Parallax Factor property in TiledMapLayer class.

fossegutten avatar Mar 28 '21 19:03 fossegutten

This shouldn't be too hard :

  • Add a Vector2 ParallaxFactor property to TiledMapLayer
  • Extract it from the tiled map file during reading.
  • Add it to the TiledMapLayer during processing.

The rest could be handled by the user for now, like this for example, using an OrthographicCamera :

foreach (var tiledMapLayer in _tiledMap.Layers)
{
    _tiledMapRenderer.Draw(tiledMapLayer, _camera.GetViewMatrix(tiledMapLayer.ParallaxFactor));
}

fdrobidoux avatar Aug 03 '21 15:08 fdrobidoux