Turn off anti-aliasing in Löve2D

I use Löve2D to write a little game. Löve2D is an open source game engine for Lua. The problem I am facing is that some anti-accident filters are automatically applied to your sprites when you draw them in non-integer positions.

love.graphics.draw( sprite, x, y )

So, when x or y is not rounded (for example, x = 100.24), the sprite looks blurry. The same thing happens when the size of the sprite is not equal, because (x, y) indicates the center of the sprite. For example, a sprite with a size of 31x30 will be blurry again, because its pixels are painted in non-integer positions.

Since I use pixel art, I want to avoid this completely, otherwise art is destroyed by this effect. The workaround that I use so far is to force the coordinates to be rounded by clogging the code with math.floor () calls and forcing all sprites to be equal in size, adding a row or column of transparent pixels with a paint program, if necessary.

Is there any command to deactivate anti-aliasing that I can call when the program starts?

+3
source share
3 answers

In case someone is interested, I asked in other places and found out that what I ask is already being requested as a function: http://love2d.org/forum/tracker.php?p=2&t=7

, Löve, (0.5.0), - antialias, SVN.

+2

, , ! ? ( ? ? ?)

, x y, , . , , , .

+4

Another possible job might be to use math.floor () to round your integers as a cheap workaround.

+3
source

Source: https://habr.com/ru/post/1715074/


All Articles