farzher Posted February 10, 2015 Share Posted February 10, 2015 My grid is supposed to have 50 rows, but it stops rendering near the end of the 41st row.If I reduce the width of each row then it renders a bit more rowsHere's my code Is there a limit to the number of draw calls I can do on a single graphics object? It's interesting that it breaks at 4096 calls, exactly 12 bits.How am I supposed to render this grid? Link to comment Share on other sites More sharing options...
hollowdoor Posted February 10, 2015 Share Posted February 10, 2015 I believe you might be losing width/height from pixels in the line around the grid squares. Add the pixel width of your lines from either side of width, and height to your width, and height in the loop. You might only need to add one, or the other. Link to comment Share on other sites More sharing options...
farzher Posted February 10, 2015 Author Share Posted February 10, 2015 I believe you might be losing width/height from pixels in the line around the grid squares. Add the pixel width of your lines from either side of width, and height to your width, and height in the loop. You might only need to add one, or the other.I don't think that's the problem.That's just making the tiles overlap a bit, but look at the bottom right. There's 4 tiles just missing, that's where the problem starts.although, if I comment out the linestyle, everything works (grid renders a bunch more tiles vertically) o_O Link to comment Share on other sites More sharing options...
rich Posted February 10, 2015 Share Posted February 10, 2015 To be honest there are a number of issues with the current way PIXI.Graphics draws primitives, but essentially you've a couple of options: 1) Don't use Graphics for the Grid. A BitmapData would be a single texture, easy to draw to, and won't exhibit this problem. 2) Don't draw rects. Draw the horizontal and vertical lines. Then you don't need half as many draw calls. symof 1 Link to comment Share on other sites More sharing options...
farzher Posted February 12, 2015 Author Share Posted February 12, 2015 Thanks Rich, that works, and it's a lot faster too Link to comment Share on other sites More sharing options...
Recommended Posts