Hello,
Hope you all are doing well and getting ready for the holidays. I had a quick question regarding sf::ConvexShape.
sf::Vector2f startPos{ 0,0 };
sf::ConvexShape shape{ 3 };
shape.setPoint(0, { 100,0 });
shape.setPoint(1, { 100,100 });
shape.setPoint(2, startPos);
shape.setFillColor(sf::Color::Transparent);
shape.setOutlineThickness(5.f);
shape.setOutlineColor({ 120,0,0 });
shape.setOrigin(150, 150);
shape.setPosition(640, 384);
and in update:
auto mousePos = sf::Mouse::getPosition(window);
if(clicked)
shape.setPoint(2, sf::Vector2f(mousePos));
Now all I'm trying to do is have point 2 follow the mouse position. The mouse position seems way off though. I'm not using a view, it's just a barebone project. I've tried
sf::Mouse::getPosition(window), I've tried using
mapPixelToCoords(sf::Mouse::getPosition(window)). But
mapCoordsToPixel has got me the most accurate results,
yet still it's off.Anyone see what my problem could be? I'm trying to setup a little sandbox to really get familiar and have a good understanding with cos/sin.
Thanks!