Page 1 of 1

Blurry Text? (Remove Anti-Aliasing)

Posted: Sun Sep 15, 2013 8:05 pm
by omgflyingbanana
I've been trying to create some games that resemble the 16-bit games from the past, and I found out when I resize images that are very small they become very blurry and not sharp. However, I found out that by using love.graphics.setDefaultImageFilter("nearest", "nearest") I can fix the problem. However, it does not work with text. Help, please?

Re: Blurry Text? (Remove Anti-Aliasing)

Posted: Sun Sep 15, 2013 8:09 pm
by Robin
You could just use a larger font size, instead of scaling the text.

Re: Blurry Text? (Remove Anti-Aliasing)

Posted: Sun Sep 15, 2013 9:12 pm
by DaedalusYoung
You can do it with text, if you use an image for font.

Re: Blurry Text? (Remove Anti-Aliasing)

Posted: Sun Sep 15, 2013 9:26 pm
by omgflyingbanana
Robin: I'm actually scaling down the text, because everything is scaled up (so the 16-bit sprites are visible)

Also, I'm using a ttf so I can't use an image.

Re: Blurry Text? (Remove Anti-Aliasing)

Posted: Sun Sep 15, 2013 10:20 pm
by omgflyingbanana
I used an image font and it didn't work either. Using :setFilter does nothing. After a bit of reading, I discovered Love 0.90 is going to have font:setFilter and hopefully integrate a set default font filter into love.graphics.setDefaultFilter.

Re: Blurry Text? (Remove Anti-Aliasing)

Posted: Sun Sep 15, 2013 10:34 pm
by omgflyingbanana
Here is a link to my .love: https://www.dropbox.com/s/u5nzoukrfer4ixo/BouncerX.love

My code organization is very messy, sorry :(

If there's any bad habits I'm making in my code management please castigate me ferociously!

Re: Blurry Text? (Remove Anti-Aliasing)

Posted: Mon Sep 16, 2013 10:08 am
by Robin
You packaged the .love wrong (zip the contents, not the folder), but anyway: I'd unscale before drawing the text. Text drawing doesn't play well with love.graphics.scale.

Code: Select all

...
    love.graphics.push()
    love.graphics.scale(scale, scale)
    ...

Code: Select all

...
    love.graphics.pop()
    love.graphics.print("score", 0, 0)
    ...