I'm looking for a way to take a snapshot of my game but only the middle part of the layout where the playing board is. I want to display it on another layout for the gameover screen along with some stats for the player but to fit it all I need to scale down the snapshot. Is that possible with built in tools?
Develop games in your browser. Powerful, performant & highly capable.
You can put a DrawingCanvas object in that position and paste all objects onto it. To scale down the image, you need to move it to a sprite:
DrawingCanvas paste everything.. Wait 0 DrawingCanvas save image Wait for the previous action to complete Sprite load image from URL: DrawingCanvas.SavedImageURL
If you want this image to be accessible on another layout, you will need to set Sprite object as global. Or save image in one layout and load it into sprite in another, but I'm not sure it will work.
yeeeeees, worked great. Not sure what the "Wait 0" does though.
Wait 0 is to wait one tick. Objects are pasted at the end of the tick, so you can't save the image immediately after pasting..