//Main function
const int screenWidth = 800; //Screen variables for renderwindow
const int screenHeight = 600;
//Make instance of the rendering window
//Input stuff
//This is in the middle of the screen, think pong paddle on the left side.
sf::Shape player1;
player1.AddPoint(0, int(screenHeight/2-50), sf::Color::White, sf::Color::White);
player1.AddPoint(20, int(screenHeight/2-50), sf::Color::White, sf::Color::White);
player1.AddPoint(20, int(screenHeight/2+50), sf::Color::White, sf::Color::White);
player1.AddPoint(0, int(screenHeight/2+50), sf::Color::White, sf::Color::White);
player1.SetColor(sf::Color(255,0,0));
That's basically the beginning of my code where I instance the shape
if (player1.GetPosition().y > screenHeight-100)
{
player1.SetPosition(0, screenHeight-100);
}
That's where I'm checking position but if I cout using:
std::cout << player1.GetPosition().y << std::endl;
It is offset by half the screen(because that's where I set the points to).
I can post the whole thing if you want but hopefully this should be enough. BTW if it matters, I draw it using:
App.Draw(player1);
EDIT: I tried this too but it doesn't seem to be doing anything:
player1.TransformToGlobal(player1.GetPosition());