Jump to content

Drawing too much lines results in a bug


InsOp
 Share

Recommended Posts

Hey dear PixiJs community,

I have this loop:

map.mapGridWidth = 54;map.mapGridHeight = 100;game.gridSize = 64;game.gridUI = new PIXI.Graphics()game.gridUI.lineStyle(2,"0x"+colorNameToHex("green"), 0.4)for (var x = 0; x < map.mapGridWidth; x++) {    for (var y = 0; y < map.mapGridHeight; y++) {       game.gridUI.drawRect ( x * game.gridSize - game.offsetX, y * game.gridSize - game.offsetY ,            game.gridSize , game.gridSize  ) ;    }}game.fgContainer.addChild(game.gridUI);

With map.mapGridWidth = 54 everything runs smooth, but as soon as I change it to 55 Ill this diagonal line:

(the other squares are expected)

post-11470-0-18120300-1417033761.jpg

(note the green diagonal line!)

post-11470-0-76157400-1417033408.jpg

(and suddenly it stops drawing the rest. the diagonal line ends here, but hard to

see with the naked eye)

 

that means that between 5400 and 5500 ill get this bug.

perhaps pixijs isnt meant to be used like this and i sure could

do it more elegant (only draw those lines which are actually in the visible screen).

but for the sake of research i want to find out what i can do other than that.

 

btw i need dimensions like 

map.mapGridWidth = 317
map.mapGridHeight = 172
and the result atm looks like this
post-11470-0-38203100-1417033798.jpg
 
so I need a little help here :)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...