0 Favourites

Can I save a snapshot in localstorage (Coloring Book Idea)

  • Hi everyone,

    So I have a project I'm trying to do where I'd like to be able to make a coloring book using the canvas plugin with the fill action. That part overall is ok. I can use the snapshot system action and paste it onto a sprite.. but what i don't get is how imagine you had more than 1 painting and wanted to move between them but not lose all your progress each time you leave a given layout / sprite..

    Maybe there is a way to capture the canvas itself and restore that in a different way. snapshot seems like the easiest way to grab a picture. Ultimately the goal would be to restore the image in full detail (no artifacting) and such.

    I imagine that in the coloring book mode there might be a couple of pictures to choose from and you go into that room to paint and such and then make changes and when you leave, save the changes till you come back again at a later time.

    Thanks,

    Caleb

  • bump.. is this something possible?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Well I have a screenshot manager & character creator/paint program(legacy) within my ADV Menu Template on the store,

    https://www.scirra.com/store/royalty-fr ... plates-429

    but I also have tutorial showing you how to save snapshots to webstorage and load them onto a sprite.

    Subscribe to Construct videos now

    But if you don't want to watch that, all you need to do is save "CanvasSnapshot" to a storage key. All you have to do is have a selected image number value global or instance varible and you can make a if key exists ""ss" & (ssSelected+1)" and have it incriment ssSelected to +1 if true, same with minusing. You need to have a empty sprite that loads from URL which you just put "WebStorage.LocalValue("ss"&ssSelected)".

    it is rather easy to do, just beware that you want the image that you want to capture to be the only thing seen as it will capture the WHOLE canvas.

  • snapshot undo seems like a bad idea. I don't know the solution to your problem, but I do now for undo to work this way you're going to need a picture a second. You're going to fill the user's hard drive. Imaging having to capture all the seconds back, and pixel change...

    Unless you make it like notepad.. either only allow 5-10 undo steps.. or... undo is farther a part... like take a snap shot every minute or so... on project start you might want to consider deleting all files from the folder that aren't relative anymore..

  • Thats awesome undeadbobop I'll check out the store item.

    The video is very helpful, thanks!

    Is it legacy because it's using webstorage still?

  • part12studio Sorry Just updated more information on the post to avoid double post, it is legacy it isn't part of the master template and isn't being updated. Has nothing to do with anything with construct 2, sorry for the confusion.

    As for undo functionality, it isn't a good idea to save the image rather have the brush marks as their own objects, so you can destroy them or make them transparent entirely in order of last created.

    Doing this would allow you to tint the brush objects, and mess with their transparency(something I didn't do in the template), along with that you can make different shapes by having them as sprite objects, the only down fall is performance might not be good depending on how far you want the undo functionality to go back.

  • ok cool yea I just bought the ADV product, thanks for that tip / lead. I'm going to look into this. doing a full screen capture is no problem. I can design around that.

    Thanks,

    Caleb

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