Hi,
I want to divide an image into random sized parts. I need this for some kind of puzzle game I'm writing with a friend. Dividing an image into even sized parts like this:
[attach=#1]
is not a problem at all. But how could I divide in into randomsized parts like this:
[attach=#2]
The algorithm I'm searching must be capeable of slicing any image in a variable amount (which is set by the player) of parts. The resulting images (parts) should not be smaller than X pixels and not larger than Y Pixels. The parts may not overlap each other. I have no idea how to do this.
I want to divide an image into random sized parts. I need this for some kind of puzzle game I'm writing with a friend. Dividing an image into even sized parts like this:
[attach=#1]
is not a problem at all. But how could I divide in into randomsized parts like this:
[attach=#2]
The algorithm I'm searching must be capeable of slicing any image in a variable amount (which is set by the player) of parts. The resulting images (parts) should not be smaller than X pixels and not larger than Y Pixels. The parts may not overlap each other. I have no idea how to do this.









But I think keeping track of only producing rect-shapes will be very tricky. I have to use only rect-shapes, because the puzzle will be jpg + javascript based, so there is no way to overlay other shaped images (because of the missing transparency). I think I will try to prototype this Idea on the weekend - Thanks
It works very well 
