EnderPearl_MC
EnderPearl_MC

Reputation: 21

Lua / Love 2d : Scale Image with pixels

Hello !

With Lua and Love 2d, I'd like to resize an image with pixels :

img = love.graphics.newImage("assets/bg.png")

-- resize the image (500 x 400)

function love.draw()

    love.graphics.draw(bg, 0, 0)

end

Upvotes: 1

Views: 1534

Answers (1)

guilleatm
guilleatm

Reputation: 11

What I understand is that you want to scale an image in pixelart style and you don't want this blurred effect, you can set the default filter to nearest before loading the images with love.graphics.newImage(path):

love.graphics.setDefaultFilter("nearest", "nearest")
love.graphics.newImage(path)
love.graphics.setDefaultFilter("linear", "linear") --[[ If you want to let the filter like before ]]

I recommend you to visit love2d forums. If this don't work, visit this forum

Upvotes: 1

Related Questions