I can't figure out how to draw a tilemap centered at the origin of the window with a modified view.
Here is my modified view:
View view;
view.setCenter(Game::Entity::g_eLocal.sprite.getPosition());
view.setSize(((float)Engine::windowSize.x), ((float)Engine::windowSize.y));
view.zoom(0.75);
window->setView(view);
My TileMap class:
https://www.sfml-dev.org/tutorials/2.1/graphics-vertex-array.php#example-tile-mapHere is my tilemap:
TileMap TM;
if (!TM.load("Data//Images//64x64grass.png", sf::Vector2u(32, 32), level, 16, 8)) { return -1; }
When I draw the tilemap, it doesn't set it to the origin of the current view.
I have determined that the view zoom is messing it up:
zoom = 1 works perfectly:
https://i.imgur.com/0dSloIz.pngzoom = 0.75 does not:
https://i.imgur.com/KidZMNY.pngit does not update the origin of the window
Also, how do i set the top left corner of the tilemap to the origin of the window?