Lua / Love 2d:使用像素缩放图像

问题描述 投票:0回答:1

你好!

[使用Lua和Love 2d,我想用像素调整图像大小:

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

-- resize the image (500 x 400)

function love.draw()

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

end
image lua resize scale love2d
1个回答
0
投票

[我了解的是,您希望以pixelart样式缩放图像,并且不希望出现这种模糊效果,可以在使用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 ]]

我建议您访问love2d论坛。如果这不起作用,请访问this forum

© www.soinside.com 2019 - 2024. All rights reserved.