add learning are & sub_area

This commit is contained in:
dev sp
2023-12-19 15:17:26 +00:00
parent 9dd93344dd
commit a655a43e47
4 changed files with 46 additions and 12 deletions

View File

@@ -24,6 +24,8 @@ import Layout from '../../layouts/Layout.astro';
noticeHeight = 0;
downloadWidth = 67;
downloadHeight = 200;
learningWidth = 200;
learningHeight = 400
} else {
submitWidth = 380;
submitHeight = 95;
@@ -31,6 +33,8 @@ import Layout from '../../layouts/Layout.astro';
noticeHeight = 0;
downloadWidth = 180;
downloadHeight = 70;
learningWidth = 450;
learningHeight = 400
}
var assetsList = {}
var snapshotButton;
@@ -105,10 +109,13 @@ import Layout from '../../layouts/Layout.astro';
fetch(`https://management.beanstalkedu.com/items/game_drawing/${encodeURIComponent(paramsID)}`)
.then(response => response.json())
.then(({ data }) => {
console.log(data)
const screenCenterX = this.cameras.main.worldView.x + this.cameras.main.width / 2;
const baseFontSize = 15;
const responsiveFontSize = (window.innerWidth / 280) * baseFontSize;
const descrptText = this.add.text(screenCenterX, 70, data.description, { font: `${responsiveFontSize}px quicksand`, fill: '#7c4c23', }).setOrigin(0.5);
this.add.text(customWidth / 2 - learningWidth, customHeight / 2 - learningHeight, data.LearningArea, {font: `20px`}).setTint(0X7C4C23)
this.add.text(customWidth / 2 - learningWidth, customHeight / 2 - learningHeight + 20, data.LearningSubArea, {font: `20px`}).setTint(0X7C4C23)
})
.catch(error => {
console.error('Error fetching initial data:', error);