Pixel Art and anti-aliasing
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Pixel Art and anti-aliasing
Hello i have some pixel art that is 8x8 and i wish to have it scaled up. my problem is when the image is scaled the pixels are blurred. i want to achieve a nice crisp blocky look. If anyone could help me that would be great
- Attachments
-
- spaceship.love
- Problem Code
- (2.99 KiB) Downloaded 168 times
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Pixel Art and anti-aliasing
Check out (Image):setFilter or love.graphics.setDefaultImageFilter, using the "nearest" filter mode.
Re: Pixel Art and anti-aliasing
Thank you! The problem is solved !
Here's the solution :
Here's the solution :
Code: Select all
function love.load()
love.graphics.setDefaultImageFilter("nearest", "nearest")
ship = love.graphics.newImage("images/spaceship.png")
end
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Pixel Art and anti-aliasing
Also consider using integer coordinates (with math.floor) when you draw the ship on the screen. If you use raw float values, you might get "pixel artifacts" - the pixels of the image will "change" while the ship moves.
When I write def I mean function.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 4 guests