I am getting the error and have absolutely no idea why!
//create a circle shape.
sf::CircleShape shape;
shape.setRadius(25);
shape.setFillColor(sf::Color(100,250,250));
//circle collision geometry
circle circleTest(shape.getPosition.x,shape.getPosition.y,shape.getRadius())
Circle is the class for circle collision geometry.And it fails on the constructor
(shape.getPosition.x,shape.getPosition.y,shape.getRadius())
I don't know why i got the error , it worked fine then all of a sudden gave me the error in the title.
getPosition
is a function. You must call it and access its return value’s members.
The reason why you are getting this error is because sf::Shape::getPosition() is a method and you need to call that method to get the position. After you make that call you can then access the .x and .y members of the sf::Vector2f that sf::Shape::getPosition() returns.
So your code should instead look like this.
//create a circle shape.
sf::CircleShape shape;
shape.setRadius(25);
shape.setFillColor(sf::Color(100,250,250));
//circle collision geometry
circle circleTest(shape.getPosition().x,shape.getPosition().y,shape.getRadius())
sf::Shape::getPosition()