function love.draw()
love.graphics.setColor(0,255,0,255)
love.graphics.line(0,0,0,150)
love.graphics.line(0.5,150,0.5,300)
love.graphics.line(1,300,1,450)
end
edit- is there anything wrong with doing a love.graphics.translate(0.5, 0.5) at the top of every draw() ?
If two line tips are on an even grid coord (imagine a vertical line for simplicity), then half the line has to be to one side of the coord, and the other half will be on the other side. So, a 1 pixel wide line will half half a pixel to the left of the grid, and half a pixel to the right. A 2 pixel wide line would have 1 pixel to each side.
There's nothing wrong with a translate at the beginning of each draw statement. Most camera systems in Love rely heavily on this.
tentus wrote:If two line tips are on an even grid coord (imagine a vertical line for simplicity), then half the line has to be to one side of the coord, and the other half will be on the other side. So, a 1 pixel wide line will half half a pixel to the left of the grid, and half a pixel to the right. A 2 pixel wide line would have 1 pixel to each side.
There's nothing wrong with a translate at the beginning of each draw statement. Most camera systems in Love rely heavily on this.
I guess that makes sense, although it still seems "weird" to me. I'm guess I'm used to the coordinates being the pixels themselves, not something overlaid on top of them.
How does this affect blits? If I blit something say at (1,1) and want to draw a box around it, should it be at (0.5,0.5) to start? Or, if you blit something at (1,1), does that put half of the first row/col of the image on one side of (1,1) and the other half on the other side? That's why this seems confusing to me...