Skip to content

Offstage Drag Prevention

let malharro = new Image();
malharro.src = 'static/malharro.jpg';
malharro.onload = () => {
const offstage = new headbreaker.Canvas('offstage-canvas', {
width: 400, height: 400, image: malharro,
// ... more configs ...
preventOffstageDrag: true,
fixed: true
});
offstage.adjustImagesToPuzzleHeight();
offstage.autogenerate({
horizontalPiecesCount: 3,
verticalPiecesCount: 3
});
offstage.shuffleGrid();
offstage.draw();
}