It looks like you're new here. If you want to get involved, click one of these buttons!
Grid = Core.class(Sprite) function Grid:init(rows, columns, w, h, bColor, fColor, lColor, alpha) local width = columns*w local height = rows*h local rect = helper:createRectangle(width, height, bColor or 0x000000, alpha or 0.5, 8, fColor) ---simply create an Rectangle self:addChild(rect) local lines = Shape.new() ---this lines not show on mac or ios device lines:setFillStyle(Shape.NONE) lines:setLineStyle(1, lColor or 0xffffff,alpha or 0.5) lines:beginPath() for i = 1, rows - 1 do lines:moveTo(0, i * h) lines:lineTo(width, i * h) end for i = 1, columns - 1 do lines:moveTo(i * w, 0) lines:lineTo(i * w, height) end lines:endPath() self:addChild(lines) end |
Comments
I've tried using 2px or 3px lines and it worked fine. I think it can be problem of automatic scaling, that object is too small to be shown.
I will try when I got home,thanks.
https://sites.google.com/site/xraystudiogame
https://sites.google.com/site/xraystudiogame