stnight99 Posted May 31, 2016 Share Posted May 31, 2016 Hello Team, I wanna ask if there are some way to create a grid, for example, i would like to create a 4x4 grid, and each grid i will insert an image, is this possible on PhaserJS? Thanks Link to comment Share on other sites More sharing options...
drhayes Posted May 31, 2016 Share Posted May 31, 2016 You can add and position images anywhere you want, so yes that's possible. Besides positioning the images where you want is there other functionality you have in mind? Link to comment Share on other sites More sharing options...
stnight99 Posted May 31, 2016 Author Share Posted May 31, 2016 @drhayes I mean, if PhaserJS have a functionality to create grid. I'm creating a memory game, so i need to position the cards dynamically, for example if the config from the server says the game should be 4x6, or 6x10, then create an exact grid for the cards. Link to comment Share on other sites More sharing options...
mcolman Posted June 1, 2016 Share Posted June 1, 2016 I have made my own GridLayout class. I could possibly open source it, but it's still pretty immature. Want me to add it to github anyway? azzz and stnight99 2 Link to comment Share on other sites More sharing options...
stnight99 Posted June 1, 2016 Author Share Posted June 1, 2016 @mcolman That's great!! I wanna see your GridLayout class. And maybe you should create it as a plugin Link to comment Share on other sites More sharing options...
mcolman Posted June 1, 2016 Share Posted June 1, 2016 https://github.com/mattcolman/phaser-grid-layout Link to comment Share on other sites More sharing options...
stnight99 Posted June 1, 2016 Author Share Posted June 1, 2016 @mcolman Thanks for this, gonna check this later Do you have any live example on how to use this? Link to comment Share on other sites More sharing options...
mcolman Posted June 1, 2016 Share Posted June 1, 2016 I've just added documentation and example code in grid_layout.js Link to comment Share on other sites More sharing options...
agogiam Posted August 2, 2017 Share Posted August 2, 2017 @matt_colman - This seems quite useful! But it didn't work for me. Will it not work with Phaser? I am including <script src="lodash.min.js"></script> and passing the right parameters to the constructor. Please help! Thanks in advance! Link to comment Share on other sites More sharing options...
Recommended Posts