I was building a grid today with 32x32 rectangles, each having a 1 pixel spacing.
However, as long as I kept the spacing at 1px, the rectangles started overlapping each other every other 2 rectangles.
As soon as I increased the spacing to 2px, the spacing between the rectangles was showing up as 1px in between.
Here is the code:
local grid = 8
local gridSpacing = 1
for iX = 1, grid do
local p = display.newRect( 0, 0, 32, 32 )
p:setReferencePoint( display.TopLeftReferencePoint )
p.x = ( ( iX - 1 ) \* pixelSize ) + ( ( iX - 1 ) \* gridSpacing )
p.y = 0
end
Can anyone tell me what’s going on?
The config.lua is set to 768 x 1024, letterboxed.
[import]uid: 86582 topic_id: 28903 reply_id: 328903[/import]