little changes
parent
df9a03515e
commit
515ca18fcc
|
@ -262,7 +262,7 @@ class MyGame extends Phaser.Scene {
|
|||
// Calculate responsive font size based on screen width
|
||||
const responsiveFontSize = (window.innerWidth / 950) * baseFontSize; // Adjust 800 to your desired reference width
|
||||
const descrptText = this.add.text(screenCenterX, 70, data.description, {
|
||||
font: `${responsiveFontSize}px quicksand`,
|
||||
font: `600 ${responsiveFontSize}px Quicksand`,
|
||||
fill: '#7c4c23',
|
||||
}).setOrigin(0.5);
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -284,10 +284,6 @@ import Layout from "../../layouts/Layout.astro";
|
|||
firstLayer.setAlpha(0.5);
|
||||
}
|
||||
});
|
||||
|
||||
// Repeat the above code for secondLayer and thirdLayer
|
||||
|
||||
// Add this code for secondLayer
|
||||
secondLayer.on('dragstart', (pointer) => {
|
||||
secondDragStartPoint.x = pointer.x;
|
||||
secondDragStartPoint.y = pointer.y;
|
||||
|
|
Loading…
Reference in New Issue