hi
i have my drawables witch have their centre shifted 1 pixel x and y when i rotate them
i choosedodds width and height to have a real center point for the rotation
sprite are 49 * 35 i use setorigin(24,17)
tried 48 * 34 in texturerect or vertexbuffer but no
i don't know how to get rid of that. tried with
made a simple program with sf::sprites and it's the same
thx
original on bottom rotated above. red dot should always be in black roof
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/CircleShape.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Texture.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(300, 300), "Test divers", sf::Style::Close);
sf::Texture texture;
texture.loadFromFile("cars.png");
sf::Sprite car;
car.setTexture(texture);
car.setTextureRect(sf::IntRect(0,0,49,35));
car.setOrigin(24, 17);
car.setPosition(150,150);
sf::CircleShape circle(1);
circle.setFillColor(sf::Color::Red);
circle.setPosition(car.getPosition());
window.clear(sf::Color::White);
window.draw(car);
window.draw(circle);
car.setPosition(150,90);
car.setRotation(180);
window.draw(car);
circle.setPosition(car.getPosition());
window.draw(circle);
window.display();
while(1) ;
}