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

Hello,

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.
B
3
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.
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 242
Reputation: 2,306


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests