cutting up image

For questions about using Classic.

Post » Tue Jun 09, 2009 9:52 am

If I had a picture for example 288x288 pixels in size,how could I cut it up at runtime to make 9 sprites of 96x96 pixels ,each with an individual different image on each one?
B
27
S
2
G
3
Posts: 61
Reputation: 2,498

Post » Tue Jun 09, 2009 10:54 am

This is pretty hard to do; you'd have to use the Image Manipulator to load the main image in, then crop it to the images you need, save them, then load them into sprites. What are you trying to do?
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Jun 09, 2009 11:09 am

Trying to modify my Slider game to use an image.At runtime I would like to load a random image cut it up and then use this as the game tile.
B
27
S
2
G
3
Posts: 61
Reputation: 2,498

Post » Tue Jun 09, 2009 11:15 am

Sounds like he's trying to make a stretchable 9-patch image, for making pretty boxes.

I was thinking about this just the other day - the four corners would be regular sprites (aligned TL, TR, BL, BR corners), the top and bottom would be a tiled background running left-right, the sides would be tiled backgrounds top-bottom, and the middle would be a regular tiled bg in all directions.

Then you could resize it at run-time and have all the parts snap to where they should be and have nice looking boxes for buttons, UI, etc. And I think he wants a way to automate this process.

Of course, I could be wrong :P

Edit: and it appears I was wrong. And slow.
B
2
S
2
G
3
Posts: 105
Reputation: 1,510

Post » Tue Jun 09, 2009 11:21 am

depending on how much you know about displacement, this may or may not make sense

let me know if you need help understanding what I did

the tiles are drag droppable:
download cap here



one event



Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jun 09, 2009 11:45 am

[quote="Rich":1tom87fe]This is pretty hard to do; you'd have to use the Image Manipulator to load the main image in, then crop it to the images you need, save them, then load them into sprites. What are you trying to do?[/quote:1tom87fe]

Image manipulator is only saving in multiples of 256 right now.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jun 09, 2009 12:04 pm

here's a 98 version for those who don't have 99 installed:

download cap here
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests