I'm trying to center my text inside of box, but I'm having some trouble doing so.
Does anyone know what is wrong with this code?
x,y is the corner in the top-left.
x2,y2 is the corner in the bottom-right.
x = left
y = top
x2 = right
y2 = bottom
sf::FloatRect StringRect( sf_text.GetRect() );
canvas.SetPosition(x, y);
sf_text.SetPosition(x, y);
sf_text.Move(((x2-x)/2)-StringRect.GetWidth()/2,((y2-y)/2)-StringRect.GetHeight()/2);