MonoGame.Extended
MonoGame.Extended copied to clipboard
[Tiled] Add Parallax Factor in TiledMapLayer (New in Tiled 1.5)
Add a Vector2 property for the new Parallax Factor property in TiledMapLayer class.
This shouldn't be too hard :
- Add a
Vector2 ParallaxFactor
property toTiledMapLayer
- 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));
}