I need a way to stop pixel art being blurred, how would I do this (preferably without resizing the image outside of love2d). I need a way for me to be able to change it's size in game, but keeping a 32x32 image.
I know that in Unity3D, you can just change the image import settings to 'point' instead of 'bilinear'. Is there anything like this in love? I have attached a screenshot of my 32x32 image tripled in size.
How to stop pixel art from becoming blurred?
Re: How to stop pixel art from becoming blurred?
image:setFilter("nearest", "nearest"). You can also do love.graphics.setDefaultFilter("nearest", "nearest") before loading the images.
Re: How to stop pixel art from becoming blurred?
Thanks! It seems like it worksveethree wrote:image:setFilter("nearest", "nearest"). You can also do love.graphics.setDefaultFilter("nearest", "nearest") before loading the images.
-
- Party member
- Posts: 125
- Joined: Wed Nov 26, 2014 6:43 am
Re: How to stop pixel art from becoming blurred?
Make sure to put it in line 1 since images loaded before that function will still have the "linear" filter.
Re: How to stop pixel art from becoming blurred?
I think the optimal place would be near the top of love.load (rather than at the top of the file), for readability and consistency. I'm not sure what happens if you run that before love.load, since I don't think it's guaranteed that graphics are ready.Sosolol261 wrote:Make sure to put it in line 1 since images loaded before that function will still have the "linear" filter.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: How to stop pixel art from becoming blurred?
I've always just put it at the top of love.load and it works just fine.
-
- Party member
- Posts: 125
- Joined: Wed Nov 26, 2014 6:43 am
Re: How to stop pixel art from becoming blurred?
There are people who require files outside of love.load (like me) and if you make an image in any of those files it will use the linear filter.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: How to stop pixel art from becoming blurred?
Either way put it before you load any images. Else you'll have to manually setFilter("nearest") for all of them later.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests