• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating puzzle pieces help

Community Beginner ,
Sep 07, 2011 Sep 07, 2011

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();
        }

TOPICS
ActionScript

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 07, 2011 Sep 07, 2011

Copy link to clipboard

Copied

anyone ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 07, 2011 Sep 07, 2011

Copy link to clipboard

Copied

Here take a look at this:  https://rapidshare.com/files/2453657503/jigsawPuzzle.zip

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 07, 2011 Sep 07, 2011

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

http://comps.canstockphoto.com/can-stock-photo_csp4999540.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 07, 2011 Sep 07, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines