0

I've encountered a problem drawing SFML Text. In my application, I use views as a sort of coordinate system for my application. Thus, a typical view would be 10 x 10 or 20 x 20. All my normal drawing functions work fine, when drawing primitives and lines, etc., and the relevant code doesn't have to know about the coordinate system.

However, when I tried to draw text to the screen, I found that it appeared gigantic. When I reduced the font size drastically, it appeared extremely blurry and pixellated, as if it were trying to render to GIANT pixels that are 1x1 in my view.

Is there a way to draw text with a standard font size, in a way that it won't be affected by the view? Ideally, my text would width/size-wise on any view? How can I accomplish this?

Thanks for any input!

(P.S., I'm using SFML 2.0, for reference)

1 Answer 1

1

You can set another view (i.e. apply OpenGL transformation) and render text after it. Here is an example from sfml tutorial:

sf::View View(sf::FloatRect(600, 700, 1400, 1300));
App.SetView(View);

// Draw the game...

App.SetView(App.GetDefaultView());

// Draw the interface...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.