change text size drag v2

pull/2/head
dev sp 2024-02-08 16:25:08 +00:00
parent 5552396b9d
commit 06709e02d7
1 changed files with 1 additions and 1 deletions

View File

@ -300,7 +300,7 @@ import Layout from '../../layouts/Layout.astro';
]; ];
const screenCenterX = this.cameras.main.worldView.x + this.cameras.main.width / 2; const screenCenterX = this.cameras.main.worldView.x + this.cameras.main.width / 2;
// Base font size for your text // Base font size for your text
const baseFontSize = 30; const baseFontSize = 20
// Calculate responsive font size based on screen width // Calculate responsive font size based on screen width
const responsiveFontSize = (window.innerWidth / 950) * baseFontSize; // Adjust 800 to your desired reference width const responsiveFontSize = (window.innerWidth / 950) * baseFontSize; // Adjust 800 to your desired reference width
const descrptText = this.add.text(screenCenterX, 76, data.description, { const descrptText = this.add.text(screenCenterX, 76, data.description, {