[Request] Canvas snapshot whole layout

0 favourites
  • 8 posts
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • Was just playing with the canvas snapshot, and found that it only grabs the viewport.

    The request would be to grab the whole layout.

    You could, for example create a mask of a bunch of tiles, then delete those tiles, and then load the snapshot into a sprite via load by url.

    It would be quite useful if say you had hundreds of tiles that eat up fps.

  • You already can do that with the canvas plugin. Grabbing the whole layout could be a problem if someone with a large layout tried it.

    There's a chance the reason fps are getting eaten up is more to do with collision detection than rendering anyway, unless you're talking about mobile, in which case it could be both.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Perhaps if we had the option to get the layout, or just the viewport...?

    As you can imagine a layout of just 1024x1024 with 16X16 tiles would get you thousands of objects. Even without collision detection that is guaranteed to go slow.

    Creating a mask, and destroying the tiles that are for visual purposes solves all of those woes.

    Im actually using Rojo's canvas now, however a large canvas kills performance when in webgl.

  • Well, you could stitch a larger snapshot of smaller viewport snapshots, just reposition the viewport each time. But for what you're trying to do, wouldn't it be better to put those tiles in a family, then plot a dot/smaller object onto canvas for each object in the family?

  • Since that would functionally destroy tiles, wouldn't some sort of portal rendering to disable/enable collisions or destroy/load tiles be better? I specifically remember asking this question (but for CC) and everyone shot down the idea because VRAM usage would skyrocket..among other things I can't recall right now.

  • Mipey

    I don't think stitching portions together would be fast enough, so timing would be an issue, especially since you have to move the camera, and then take the snapshot. It needs to happen at start of layout, plus you wouldn't want anything else like an animation to get into the picture.

    Not sure what you mean about plot a dot. I need to preserve the texture.

    Tokinsom

    Yeah, I don't think "portal" rendering would work well either. Generating hundreds of tiles when ever the view point changed would bog down the system.

  • If your willing to make your game be spastic for a frame, you can resize your viewport to the layout size, take a snapshot, and put it back. This is probably your fastest method, but could be onoying the the user.

    Good luck!

  • Yes that does work, but like you said, it would be a bit annoying.

    I have found a method where I paste into the Canvas plug, and then get the url from it and load that into a sprite.

    Then destroy the Canvas, and frame rates go back up.

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