I find the necessity to multiply, divide, add and subtract a
vector with a
scalar number
spriteName.setPosition(Vector2f(myX,myY)/2);
When I try the following code, I get compilation error
binary '/': no operator found which takes a left-hand operand of type 'sf::Vector2f' (or there is no acceptable conversion)
So I had to manually make my own
(free-function) overload...
I checked on GitHub and there
is actually an overload
Line
130 of
this github pagetemplate <typename T>
inline Vector2<T> operator /(const Vector2<T>& left, T right)
{
return Vector2<T>(left.x / right, left.y / right);
}
But apparently it doesn't work