How do I transfer pictures

0 favourites
  • 2 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • I've been working on an educational activity on phylogenetics (tree of life). There is one question in which students drag and drop pictures of dinos into their appropriate place on a pre-drawn tree. I want to be able to basically do a canvas snapshot of the completed tree and transfer it to another layer. Is it possible to do this? I've tried to think of if there is an alternative way for them to do the question, but I'm stumped. I don't know if I explained it well, but basically I want to be able to have students drop pictures on to the pre-drawn tree and have a snapshot of that tree only (not the whole layer) transferred to a different layer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, this is possible.

    You will use the system action "Canvas snapshot" for this.

    There is one inevitable downside though:

    snapshots take a short time to be done.

    This doesn't take more than some ticks, but you may have some frames rendered before the snapshot is done.

    To take the snapshot in your case, you would want to do the following steps:

    • hide the layers that you don't want to be visible on the snapshot
    • Take a snapshot with the system action snapshot canvas
    • Add an event "On Canvas snapshot"
    • Now, you can load a Sprite's image from the URL "System.CanvasSnapshot"

    Of course, you will have to add a Sprite first.

    You would make that Sprite as big as the layer you want the screenshot displayed on.

    Make sure to put it on the appropriate layer.

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