[?] How do I combine multiple images to make one image

Get help using Construct 2

Post » Fri May 06, 2016 1:06 am

Odd question, I am using Construct 2 to make a tool for a game so that it can generate a player character spriteset.

Meaning I am trying to make it so that when a player chooses the correct body parts and presses 'Okay', it then uses variables (that are saved on one body part) to find and combine multiple files.

What I am trying to accomplish is relatively easy, I just don't know if I should execute Javascript to do it, or how else I would do it.

Example! Right now there are two objects: Body, and Hair.

Body has two instance variables, Body, and Hair. Body saves as Body_p01 (where 02 is part 1), Hair has Hair_p01.

When I click Submit I want it to combine Body_p01 with Hair_p01 and save it as one png.

Thanks for any help with this, I am trying to make a useful tool for another community as well.
Posts: 98
Reputation: 4,794

Post » Fri May 06, 2016 2:20 am

Snapshot canvas
Take a screenshot of the current display. This triggers On canvas snapshot when the snapshot is ready, and the resulting image can be accessed with the CanvasSnapshot system expression. This can then be loaded in to a sprite or tiled background, sent to a server, or opened with the Browser object in a new tab.

Invoke download
Invoke a URL as a file download in the browser. Even if this points to a web page or document, it will be downloaded as a file in the browser interface. The URL can point to any address on the Internet, or it can be the name of any imported project file, or it can be a data URL (useful for downloading canvas snapshots). The filename parameter allows you to choose the filename the browser gives to the download, which can be different to the name of the resource being downloaded.

You would probably want load the sprites into your layout, position them together, resize the window, then snapshot and invoke download.
Mistakes were made.
Posts: 1,620
Reputation: 62,161

Return to How do I....?

Who is online

Users browsing this forum: ferdi999, jbr190, plinkie, TRMG and 42 guests