Using Construct to cut tilesets into individual images

Post your own tutorials, guides and demos.

Post » Sun Mar 13, 2011 8:13 am

So, after a long and arduious search of a simple tool that would let me cut a tileset up into individual tiles that I could use in Construct 2, I realized something: why not just use Construct 0.x for that task?

Thing is, I've been working on a simple roguelike in Construct 0.x and I wanted to try that in C2 as well. However, methods I use in C0.x don't work in C2, because there are no texture offset methods (YET!). Therefore I needed to get individual tiles out of the tileset.

I have 256x256 tileset.png image, transparent. 16x16 tiles. I needed to cut them out of the tileset and save them as individual tiles in the .png format.

So I started a new C0.x project, created a 16x16 sprite and imported 16x16 animation frames using the built-in animation importer. Now I had a sprite with 256 animation frame, each corresponding to a tile.

Set the animation speed to zero (0). Don't want the animation to play.

Then, I added the image manipulator object.

Finally, in event sheet I made the following:

+ Trigger once (instead of at start of layout)
+ For "i" from 1 to 256
> Sprite: set animation frame to loopindex("i")
> ImageManipulator: Copy image from Sprite
> ImageManipulator: Save PNG image to AppPath%"tile-"&loopindex("i")&".png"

Then I hit the preview and... done! In the project folder I found tile-1.png to tile-256.png files, each containing the correct texture!

Importing all 256 into C2 is another issue, however, so I'll just conclude this here and now. Construct 0.x can be quite a handy tool to work with!
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Mar 14, 2011 1:07 am

I've done the same using Photoshop. Just create a grid using the ruler, get the slicer tool and tell it to cut using the grid, and then go to "save for web and devices" and its done!
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Mon Mar 14, 2011 7:43 am

Some of us don't use overpriced bloatware :)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest