1
System / Re: No mathematical operator overloads?
« on: December 23, 2017, 09:07:54 pm »
Thanks, I now have the latest version
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
spriteName.setPosition(Vector2f(myX,myY)/2);
binary '/': no operator found which takes a left-hand operand of type 'sf::Vector2f' (or there is no acceptable conversion)
template <typename T>
inline Vector2<T> operator /(const Vector2<T>& left, T right)
{
return Vector2<T>(left.x / right, left.y / right);
}
sprites[i++].setPosition(Vector2f(sizeEdge + sizeMargin + ((currentSquare - 1)*sizeRectangle), sizeEdge + sizeMargin + sizeRectangle*r));
currentSquare += 2; // the next black slot can be found after 2 slots