StarArawn / bevy_tiled

A plugin for rendering tiled maps.
MIT License
151 stars 40 forks source link

Fixed tile positioning #24

Closed Kurble closed 3 years ago

Kurble commented 3 years ago

I noticed that the tiles are not rendered at their expected locations. If I create map with TiledMapCenter(false) I would expect the top left corner of the tiled map to appear exactly in the center of the screen when using an otherwise default intialized bevy 2d camera. Instead, tiles are being rendered with an offset to the origin of exactly half the tile size.

This pull request modifies the position of the rendered tiles so that the results I would expect are displayed. This also means that a map with TiledMapCenter(true) will be exactly center around the origin.

The positions of the tiles are a bit unintuitive because the y axis in bevy goes up instead of down, as it does in tiled.

AlisCode commented 3 years ago

Can confirm that this is indeed expected behaviour.

dmtaub commented 3 years ago

merged