little changes
This commit is contained in:
@@ -56,6 +56,7 @@ import Layout from '../../layouts/Layout.astro';
|
||||
let customCursor;
|
||||
const cursorSizeMultiplier = 1;
|
||||
let isErasing = false;
|
||||
let snapNotice;
|
||||
|
||||
function preload() {
|
||||
this.load.image('outline', assetsList.image);
|
||||
@@ -356,8 +357,11 @@ import Layout from '../../layouts/Layout.astro';
|
||||
snapshotButton.on('pointerdown', () => {
|
||||
captureSnapshot(this);
|
||||
});
|
||||
snapNotice = this.add.text(customWidth / 2, customHeight / 2, 'Succecfully Downloded', {font :'700 30px Quicksand', fill: '#05b3a4'});
|
||||
snapNotice.setVisible(false);
|
||||
}
|
||||
function captureSnapshot(drawingZone) {
|
||||
snapNotice.setVisible(true);
|
||||
snapshotButton.setVisible(false);
|
||||
customCursor.setVisible(false);
|
||||
drawingZone.renderer.snapshot((image) => {
|
||||
@@ -367,14 +371,13 @@ import Layout from '../../layouts/Layout.astro';
|
||||
image.style.height = '120px';
|
||||
image.style.paddingLeft = '2px';
|
||||
document.body.appendChild(image);
|
||||
|
||||
// Download the snapshot as an image
|
||||
const link = document.createElement('a');
|
||||
link.href = image.src;
|
||||
link.download = 'my_drawing.png';
|
||||
link.click();
|
||||
document.body.removeChild(image);
|
||||
|
||||
|
||||
// Clear the drawing
|
||||
// graphics.clear();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user