craftworkgames / MonoGame.Extended

Extensions to make MonoGame more awesome
http://www.monogameextended.net/
Other
1.44k stars 325 forks source link

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

Open fossegutten opened 3 years ago

fossegutten commented 3 years ago

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

fdrobidoux commented 3 years ago

This shouldn't be too hard :

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));
}