Take a snapshot of canvas and use a part of it

0 favourites
  • 4 posts
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • 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?

    Tagged:

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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..

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)