rectangles in line mode
Posted: Wed Jul 03, 2019 2:29 pm
so basically Ive been having problem with love.graphics.rectangle mode "lines". it seems like they have 1 pixel offset? Im not sure whats happening. below code and image can show what I mean. the code is expected to have both rectangles same size but they are not.
Code: Select all
function love.load()
love.window.setMode(640, 480)
love.graphics.setBackgroundColor(0, 1, 0)
love.graphics.setLineWidth(1)
love.graphics.setLineStyle("rough")
end
function love.draw()
local x, y = 320, 240
local w, h = 20, 10
love.graphics.setColor(1, 1, 1, 1)
love.graphics.rectangle("fill", x, y, w, h)
love.graphics.setColor(0, 0, 0, 1)
love.graphics.rectangle("line", x, y - h, w, h)
end