Jump to content

6 x 6 grid


dartheater
 Share

Recommended Posts

Hi,

If you mean like a grid out of a sprite then...

//create grid group
this.mygridGroup = game.add.group();
this.mygridGroup.enableBody = false;
for (i = 0; i <= 5; i++) {
    for (j = 0; j <= 5; j++) {
        var mygrid = this.mygridGroup.game.add.sprite(50 * j, 50 * i, 'mySprite');
        this.mygridGroup.add(mygrid);
    }
}

//later on you can set properties to the grid like so...
this.mygridGroup.setAll('anchor.x', 0.5);
this.mygridGroup.setAll('anchor.y', 0.5);

img.png

Good luck! :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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