Jump to content

"Layers" in Phaser


Schodemeiss
 Share

Recommended Posts

Hello,

I wish to slowly draw up a "grid" of images on a layer, and then be able to "drag" the entire "layer" around by holding down the left mouse button. Think Google Maps and the way it draws to the screen.

I've done this in SDL before by blitting to a single layer, then blitting that final constructed layer to the screen. Is a similar method available in Phaser? I was thinking something like: http://phaser.io/docs/2.4.6/Phaser.BitmapData.html ?

I would use the TileSet type methods, but I wont always have a -whole- data set to use as the grid will be being produced procedurally - IE, i'm likely to have big gaps in the data.

In the end, I'm hoping to have an interface a little like Google Maps where you can scroll around and it lazy loads some images into its grid (I dont require zooming, just panning around).

Any thoughts on the "Phaser" way to implement this? I'm not looking for full implementation, just a guide on which of the many awesome tools to use?

Thanks in advance and regards,

Schodemeiss

Link to comment
Share on other sites

I would put all the images you want to move around into a Group, and change the position of the group.  Add a little bit of logic into update to see which tiles are close to your viewport, and load them if they still need to be loaded.  I probably wouldn't bother with Phaser's TileSet, it doesn't seem to lend itself well to lazy loading, and would probably be more kludging than it's worth to make it work right.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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