How do I take a picture in-game and then use it?

Get help using Construct 2

Post » Mon Oct 24, 2016 5:31 pm


I'm fairly new to construct (just finished the tutorial yesterday) and I would like to know f there is a way to take a picture as part of the game and then use it as an asset in the next section of the game.

Thanks in advance.
Posts: 1
Reputation: 177

Post » Mon Oct 24, 2016 7:14 pm

Using vanilla Construct 2 (as in without plugins etc) I do this using CanvasSnapshot. Add the action 'Snapshot canvas', which is found in 'System'. You then need to use the corresponding condition, which is 'On canvas snapshot' (also found under 'System' to collect the image. At this pint the image is stored in the expression 'CanvasSnapshot'. You can store this data in a sprite, tilemap, or tiled background by using the action 'Set frame from URL' and entering 'CanvasSnapshot' as the URL.

Beware using this alongside save/load, as the image will be lost. Store the expression 'CanvasSnapshot' into a variable on the sprite, and have the sprite update its frame from the URL provided in the variable when the game loads.

24 functions dedicated to producing randomly generated terrain for all kinds of games.
Posts: 254
Reputation: 2,332

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 17 guests