Blurry Text? (Remove Anti-Aliasing)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
omgflyingbanana
Prole
Posts: 4
Joined: Sun Sep 15, 2013 5:01 pm

Blurry Text? (Remove Anti-Aliasing)

Post 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?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Blurry Text? (Remove Anti-Aliasing)

Post by Robin »

You could just use a larger font size, instead of scaling the text.
Help us help you: attach a .love.
User avatar
DaedalusYoung
Party member
Posts: 407
Joined: Sun Jul 14, 2013 8:04 pm

Re: Blurry Text? (Remove Anti-Aliasing)

Post by DaedalusYoung »

You can do it with text, if you use an image for font.
omgflyingbanana
Prole
Posts: 4
Joined: Sun Sep 15, 2013 5:01 pm

Re: Blurry Text? (Remove Anti-Aliasing)

Post 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.
omgflyingbanana
Prole
Posts: 4
Joined: Sun Sep 15, 2013 5:01 pm

Re: Blurry Text? (Remove Anti-Aliasing)

Post 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.
omgflyingbanana
Prole
Posts: 4
Joined: Sun Sep 15, 2013 5:01 pm

Re: Blurry Text? (Remove Anti-Aliasing)

Post 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!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Blurry Text? (Remove Anti-Aliasing)

Post 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)
    ...
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 68 guests