I'm trying to create a live minimap of the complete game world. In order to do that I'm taking a snapshot of the whole game world (not only the part that is displayed) every 100ms or so.
The code I've used to take the snapshot is this (called every update()):
if (game.time.time < this.nextUpdate) { return; } { this.stage.drawFull(game.world); // Draw our black border rect this.thumbnail.rect(0, 0, this.thumbnail.width, this.thumbnail.width, '#000'); // And copy the stage capture to our Thumbnail (offset by 2px for the black border) this.thumbnail.copy(this.stage, 0, 0, this.stage.width, this.stage.height, 2, 2, this.thumbnail.width - 4, this.thumbnail.width - 4); this.thumbnail.update(); this.nextUpdate = game.time.time + this.updateRate; } The code that creates these variable is this (called in create()):
// The Stage is a BitmapData the size of the Game window this.stage = game.make.bitmapData(game.world.width, game.world.height); // Thumbnail will hold our scaled-down version (+4px padding for the black border) this.thumbnail = game.make.bitmapData(150, 150); // And thumbContainer is a Sprite with the thumbnail for its texture this.thumbContainer = game.make.sprite(game.width - 150, game.height - 150, this.thumbnail); // Note we add the thumbContainer to the Stage, not the World, to avoid it being captured itself game.stage.addChild(this.thumbContainer); As you can see in the bottom-right minimap - The bitmap is rendered but the background isn't rendered for the whole thing (I think it's only rendered properly for the first 800x600 pixels). Also, if the player goes further down to the bottom ledge the minimap messes up completely:
It seems like a render issue, or a bitmap copy issue, but I can't find the problem. Does anyone have any idea why is this happening?
Thanks!

