Copy link to clipboard
Copied
hello
I'm trying to created iregular puzzle pieces from a picture(in flash cs5.5) can anyone sugest some ways of doing this?maybe a usefull link.I know how to make rectangular shapes,but i'm looking in creating iregular pieces.
tks in advance
this is how my make puzzle pieces function looks like
the shapes are rectangular
private function makePuzzlePieces(bitmapData:BitmapData)
{
puzzleObjects = new Array();
for (var x:uint = 0; x < numPiecesHoriz; x++)
{
for (var y:uint = 0; y< numPiecesVert; y ++)
{
//create new puzzle piece and sprite
var newPuzzlePieceBitmap:Bitmap = new Bitmap(new BitmapData(pieceWidth,pieceHeight));
newPuzzlePieceBitmap.bitmapData.copyPixels(bitmapData,new Rectangle(x*pieceWidth,y*pieceHeight,pieceWidth,pieceHeight),new Point(0,0));
var newPuzzlePiece:Sprite = new Sprite();
newPuzzlePiece.addChild(newPuzzlePieceBitmap);
//place in bottom sprite;
otherPieces.addChild(newPuzzlePiece);
//create object to store in array;
var newPuzzleObject:Object = new Object();
newPuzzleObject.loc = new Point(x,y);// location in puzzle
newPuzzleObject.dragOffset = null;//offset from cursor
newPuzzleObject.piece = new PuzzlePiece ;
newPuzzlePiece.addEventListener(MouseEvent.MOUSE_DOWN, clickPuzzlePiece);
puzzleObjects.push(newPuzzleObject);
}
}
//randomize location of puzzle pieces
shufflePieces();
}
Copy link to clipboard
Copied
anyone ?
Copy link to clipboard
Copied
Here take a look at this: https://rapidshare.com/files/2453657503/jigsawPuzzle.zip
Copy link to clipboard
Copied
tks but this is what i have already the shapes are rectangular,i want to make them iregular like this example
i thought maybe there is some function to do this,since i want to use photos from a mobile phone,and the puzzle must be aplyed to the picture
Copy link to clipboard
Copied
My aploigies, I have never actually made a puzzle before. But take a look at this http://www.puzzlescripts.com/nm-Jigsaw_Puzzle_AS3_Simple-cp-29
it uses that styling of yours.