puzzle = new Puzzle(
$("#puzzle")[0],
'/path/to/img.jpg',
{
width: null,
height: null,
padding: 0,
size: {x: 2, y: 2},
shadow: false,
stroke: 2,
callback: {
init: null,
destroy: null,
resolve: null
}
}
);
Check if puzzle was initialized.
Reinit puzzle.
Mix the pieces of the puzzle.
Solve the puzzle.
Destroy puzzle.
Set puzzle source image.
Get puzzle source image.
Set puzzle width and height, e.g. {width: 600, height: 300}
.
Get puzzle width and height.
Set puzzle grid size.
size
may be Object
like {x: 4, y: 3}
or one of predefined String
s:
Name | x | y |
---|---|---|
big | 4 | 4 |
medium | 6 | 6 |
small | 8 | 8 |
Set puzzle grid size.
Get one of the puzzle pieces.
xy
— String
like 1-1
, 1-3
...