Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - chasemeadors

Pages: [1]
1
Graphics / Text appears gigantic and pixellated? (SFML 2)
« on: December 27, 2011, 10:38:22 am »
Hi Laurent, Thanks for the response.

I didn't realize until your suggestion that I'm free to change the view whenever I like in my drawing code - as long as I change it back before Display(). That does indeed solve my issue. Nice to know, though, that text behaves like a Sprite.

2
Graphics / Text appears gigantic and pixellated? (SFML 2)
« on: December 27, 2011, 05:00:28 am »
Also, as another illustration:

800 x 600 pixel view (default):

Code: [Select]
sf::Text("Hello", sf::Font::GetDefaultFont(), 40);

now switch to a 200 x 150 view (one fourth):

Code: [Select]
sf::Text("Hello", sf::Font::GetDefaultFont(), 10);

(font size is one fourth as well)

The text fills the exact same area on the screen - as it should, because the ratio is the same (fourth size view, fourth size font size)

However, the only difference in the second version is that the text is blurry!

3
Graphics / Text appears gigantic and pixellated? (SFML 2)
« on: December 27, 2011, 04:15:58 am »
What I don't understand is, if I create a sf::Shape primitive, say, rectangle, and tell it to have a size measured in view units, it still "fills" every pixel within the box described.

For example, if I'm in the default view (800 x 600 px), and draw a square of size 100x100 at the origin (which would be pixels), then I "zoom in" on that square, by setting the view to (0, 0, 200, 200), the square is still "continuous" on the new view, it "fills" every pixel.

However, let's say I create an sf::Text of say font size 40, and display it along with with the square. It looks normal, but when I zoom in, the text is blurred, as if it simply stretched the image.

In other words, text only looks right in a true pixel == unit view. Is sf::Text not vector graphics like other Shapes?

4
Graphics / Text appears gigantic and pixellated? (SFML 2)
« on: December 27, 2011, 01:15:50 am »
(This is using SFML 2)

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 - it just draws things to scale assuming the view is measured in meters.

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. I used the following code, my current view at the time is sf::View(-10, 7.5, 20, -15) (a typical graphing coordinate system)

Code: [Select]
sf::Text t(s, sf::Font::GetDefaultFont(), 5);
t.SetColor(sf::Color(0, 0, 0));
t.SetPosition(-8, -4);


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? Is there a way I can accomplish this?

Thanks for any input!

(P.S., I'm using SFML 2.0, for reference)
Code: [Select]

Pages: [1]
anything