1
Graphics / Re: Multiple problems with text drawing
« on: April 12, 2013, 01:50:06 pm »Since you set the text position to the center of the box, it should work only if the text origin is set to its center. And the default origin is the top-left corner. Yes, there are known issues about text centering, but without knowing exactly what you do (a complete/minimal example would help a lot for that) it's complicated to tell you what to do.
Well, that's how i'm setting the position:
text.setPosition(
static_cast<int>(button_x + ((button_width - text_bounds.width) / 2)),
static_cast<int>(button_y + ((button_height - text_bounds.height) / 2)));
static_cast<int>(button_x + ((button_width - text_bounds.width) / 2)),
static_cast<int>(button_y + ((button_height - text_bounds.height) / 2)));
Without setOrigin() function:
...and now with setOrigin()(setting the origin to the center of the box):
text.setOrigin(button_x + button_width / 2, button_y + button_height / 2);
Quote
Yes. It's really strange, I was sure that it was fixed...I didn't use the setView() function of the RenderWindow object before, now i'm using it and those lines/dots do not appear anymore.