1
Graphics / Re: setScale flipping weird graphics
« on: April 25, 2014, 08:19:00 pm »IntRect is made of Left, Top, Width and Height. It was Right and Bottom for the last two in SFML 1.x.
This line is wrong in SFML 2.0:currenttile.setTextureRect(sf::IntRect(tilepos_x, tilepos_y, tilepos_x + tilesize_x, tilepos_y + tilesize_y));it should go:currenttile.setTextureRect(sf::IntRect(tilepos_x, tilepos_y, tilesize_x, tilesize_y));
Because of the order you drew it in when scale was 1, 1 it was looking ok, the 'additional' parts of each tile got overdrawn by later tiles and last row and column drew the 'additional' part outside the window.
That's also why result is so weird with different scale, the tiles rotated around (since texture rect is larger the origin isn't actually in the middle of sprite) and trampled over each other this time...
Very ironic how old SFML Rect class usage, window size, tile drawing order and scale worked together for this 'bug'.
Thanks, it's working now.