Snapping mouse to grid
This commit is contained in:
parent
f765ec74ef
commit
74fdcd51f7
4 changed files with 29 additions and 11 deletions
2
grid.lua
2
grid.lua
|
@ -30,7 +30,7 @@ function Grid:draw()
|
|||
for x = 1, self.size.x do
|
||||
for y = 1, self.size.y do
|
||||
local px, py = x * Config.cellSize, y * Config.cellSize
|
||||
love.graphics.circle( "fill", px, py, Config.pointRadius )
|
||||
love.graphics.circle( "fill", px - Config.cellSize / 2, py - Config.cellSize / 2, Config.pointRadius)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue