Pozycja myszy:
int x = sf::Mouse::getPosition().x;
int y = sf::Mouse::getPosition().y;
W przypadku RectangleShape masz metodę getPoint. Ona także zwraca wektor pozycji punktów w lokalnym układzie prostokąta (trzeba dodać wektor pozycji z getPosition() ), więc możesz wybrać, którą składową dokładnie chcesz. Metoda getPoint przyjmuje indeks punktów 0 - 3. Przykład:
sf::RectangleShape rectangle;
rectangle.setPosition(200, 100);
rectangle.setSize( sf::Vector2f( 20, 20) );
float x0 = rectangle.getPosition().x;
float y0 = rectangle.getPosition().y;
cout<<rectangle.getPoint(0).x+x0<<" "<<rectangle.getPoint(0).y+y0<<endl;
cout<<rectangle.getPoint(1).x+x0<<" "<<rectangle.getPoint(1).y+y0<<endl;
cout<<rectangle.getPoint(2).x+x0<<" "<<rectangle.getPoint(2).y+y0<<endl;
cout<<rectangle.getPoint(3).x+x0<<" "<<rectangle.getPoint(3).y+y0<<endl;
Lepiej jest jednak korzystać z wektorów od razu:
sf::RectangleShape rectangle;
rectangle.setPosition(200, 100);
rectangle.setSize( sf::Vector2f( 20, 20) );
sf::Vector2f A = rectangle.getPosition() + rectangle.getPoint(0);
sf::Vector2f B = rectangle.getPosition() + rectangle.getPoint(1);
sf::Vector2f C = rectangle.getPosition() + rectangle.getPoint(2);
sf::Vector2f D = rectangle.getPosition() + rectangle.getPoint(3);
cout<<A.x<<" "<<A.y<<" "<<endl;
cout<<B.x<<" "<<B.y<<" "<<endl;
cout<<C.x<<" "<<C.y<<" "<<endl;
cout<<D.x<<" "<<D.y<<" "<<endl;