full updated

This commit is contained in:
2023-09-16 20:51:26 +05:30
parent 5ac894fc92
commit 8c88aea0a9
3 changed files with 110 additions and 100 deletions

View File

@@ -291,9 +291,7 @@ import Layout from '../../layouts/Layout.astro';
slider.max = '80';
slider.value = brushSize.toString();
slider.className = 'slider';
// slider.style.width = `${window.innerWidth / 2}px`;
slider.addEventListener('input', (event) => {
brushSize = parseInt(event.target.value);
slider.style.backgroundSize = `calc(${(brushSize - 2) * 100 / 18}% + 20px) 100%`;
@@ -323,8 +321,8 @@ import Layout from '../../layouts/Layout.astro';
// Disable the default cursor
this.input.setDefaultCursor('none');
const borderThickness = 2;
const borderColor = 0x000000; // Black color (you can customize this)
const borderThickness = 0;
const borderColor = 0xffffff; // Black color (you can customize this)
const borderGraphics = this.add.graphics();
borderGraphics.lineStyle(borderThickness, borderColor);
borderGraphics.strokeRect(drawingZone.x, drawingZone.y, drawingZone.width, drawingZone.height);
@@ -349,8 +347,8 @@ import Layout from '../../layouts/Layout.astro';
// captureSnapshot(this);
// });
}
function captureSnapshot(game) {
game.renderer.snapshot((image) => {
function captureSnapshot(drawingZone) {
drawingZone.renderer.snapshot((image) => {
image.style.width = '160px';
image.style.height = '120px';
image.style.paddingLeft = '2px';
@@ -435,7 +433,7 @@ import Layout from '../../layouts/Layout.astro';
// },
// };
// const game = new Phaser.Game(config);
// const drawingZone = new Phaser.Game(config);
// const displayW = window.innerWidth;
// const displayH = window.innerHeight;