work n new tracing game
This commit is contained in:
@@ -339,13 +339,13 @@ import Layout from '../../layouts/Layout.astro';
|
||||
graphics.strokePath();
|
||||
}
|
||||
};
|
||||
// // Add a "Save Snapshot" button
|
||||
// snapshotButton = this.add.image(window.innerWidth / 20, window.innerHeight / 2.3, 'buttonIcons');
|
||||
// // snapshotButton = this.add.text(150, 80, 'SAVE', { fill: '#7c4c23', backgroundColor : '#5e17eb', font: '600 30px quicksand', borderRadius: '20px'}).setPadding(10, 10);
|
||||
// snapshotButton.setInteractive();
|
||||
// snapshotButton.on('pointerdown', () => {
|
||||
// captureSnapshot(this);
|
||||
// });
|
||||
// Add a "Save Snapshot" button
|
||||
snapshotButton = this.add.image(window.innerWidth / 20, window.innerHeight / 2.3, 'buttonIcons');
|
||||
// snapshotButton = this.add.text(150, 80, 'SAVE', { fill: '#7c4c23', backgroundColor : '#5e17eb', font: '600 30px quicksand', borderRadius: '20px'}).setPadding(10, 10);
|
||||
snapshotButton.setInteractive();
|
||||
snapshotButton.on('pointerdown', () => {
|
||||
captureSnapshot(this);
|
||||
});
|
||||
}
|
||||
function captureSnapshot(drawingZone) {
|
||||
drawingZone.renderer.snapshot((image) => {
|
||||
@@ -357,7 +357,7 @@ import Layout from '../../layouts/Layout.astro';
|
||||
// Download the snapshot as an image
|
||||
const link = document.createElement('a');
|
||||
link.href = image.src;
|
||||
link.download = 'snapshot.png';
|
||||
link.download = 'my_drawing.png';
|
||||
link.click();
|
||||
document.body.removeChild(image);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user