csb
parent
2b296cd549
commit
5ac894fc92
|
@ -341,13 +341,13 @@ import Layout from '../../layouts/Layout.astro';
|
||||||
graphics.strokePath();
|
graphics.strokePath();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// Add a "Save Snapshot" button
|
// // Add a "Save Snapshot" button
|
||||||
snapshotButton = this.add.image(window.innerWidth / 20, window.innerHeight / 2.3, 'buttonIcons');
|
// snapshotButton = this.add.image(window.innerWidth / 20, window.innerHeight / 2.3, 'buttonIcons');
|
||||||
// snapshotButton = this.add.text(150, 80, 'SAVE', { fill: '#7c4c23', backgroundColor : '#5e17eb', font: '600 30px quicksand', borderRadius: '20px'}).setPadding(10, 10);
|
// // snapshotButton = this.add.text(150, 80, 'SAVE', { fill: '#7c4c23', backgroundColor : '#5e17eb', font: '600 30px quicksand', borderRadius: '20px'}).setPadding(10, 10);
|
||||||
snapshotButton.setInteractive();
|
// snapshotButton.setInteractive();
|
||||||
snapshotButton.on('pointerdown', () => {
|
// snapshotButton.on('pointerdown', () => {
|
||||||
captureSnapshot(this);
|
// captureSnapshot(this);
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
function captureSnapshot(game) {
|
function captureSnapshot(game) {
|
||||||
game.renderer.snapshot((image) => {
|
game.renderer.snapshot((image) => {
|
||||||
|
|
|
@ -33,7 +33,7 @@ const data = fetch(`https://management.beanstalkedu.com/items/game_tracing/${enc
|
||||||
type: Phaser.AUTO,
|
type: Phaser.AUTO,
|
||||||
width: window.innerWidth,
|
width: window.innerWidth,
|
||||||
height: window.innerHeight,
|
height: window.innerHeight,
|
||||||
backgroundColor: '#05b3a4',
|
backgroundColor: '#fff',
|
||||||
scale: {
|
scale: {
|
||||||
mode: Phaser.Scale.FIT,
|
mode: Phaser.Scale.FIT,
|
||||||
autoCenter: Phaser.Scale.CENTER_HORIZONTALLY,
|
autoCenter: Phaser.Scale.CENTER_HORIZONTALLY,
|
||||||
|
@ -78,15 +78,15 @@ function create() {
|
||||||
if (!isMobile) {
|
if (!isMobile) {
|
||||||
image = this.add.image(customWidth / 4, customHeight / 2, 'letter_img');
|
image = this.add.image(customWidth / 4, customHeight / 2, 'letter_img');
|
||||||
image.setInteractive().setDepth(1).setScale(0.6);
|
image.setInteractive().setDepth(1).setScale(0.6);
|
||||||
letter_img = this.add.image(customWidth / 1.5, customHeight / 2, 'icon_img');
|
// letter_img = this.add.image(customWidth / 1.5, customHeight / 2, 'icon_img');
|
||||||
letter_img.setDepth().setScale(0.6);
|
// letter_img.setDepth().setScale(0.6);
|
||||||
this.add.text(customWidth / 1.6, customHeight / 1.25, data.icon_name, textStyle2);
|
// this.add.text(customWidth / 1.6, customHeight / 1.25, data.icon_name, textStyle2);
|
||||||
} else {
|
} else {
|
||||||
image = this.add.image(customWidth / 2.5, customHeight / 2.5, 'letter_img');
|
image = this.add.image(customWidth / 2.5, customHeight / 2.5, 'letter_img');
|
||||||
image.setInteractive().setDepth(1).setScale(0.3);
|
image.setInteractive().setDepth(1).setScale(0.3);
|
||||||
letter_img = this.add.image(customWidth / 1.35, customHeight / 2 + 100, 'icon_img');
|
// letter_img = this.add.image(customWidth / 1.35, customHeight / 2 + 100, 'icon_img');
|
||||||
letter_img.setDepth().setScale(0.3);
|
// letter_img.setDepth().setScale(0.3);
|
||||||
this.add.text(customWidth / 2, customHeight / 1.3, data.icon_name, textStyle2);
|
// this.add.text(customWidth / 2, customHeight / 1.3, data.icon_name, textStyle2);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -122,12 +122,12 @@ function create() {
|
||||||
graphics.closePath();
|
graphics.closePath();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
// Add a "Save Snapshot" button
|
// // Add a "Save Snapshot" button
|
||||||
snapshotButton = this.add.text(customWidth - 150, customHeight - 80, 'SAVE', { fill: '#fff', backgroundColor : '#5e17eb', font: '600 30px quicksand', borderRadius: '20px'}).setPadding(10, 10);
|
// snapshotButton = this.add.text(customWidth - 150, customHeight - 80, 'SAVE', { fill: '#fff', backgroundColor : '#5e17eb', font: '600 30px quicksand', borderRadius: '20px'}).setPadding(10, 10);
|
||||||
snapshotButton.setInteractive();
|
// snapshotButton.setInteractive();
|
||||||
snapshotButton.on('pointerdown', () => {
|
// snapshotButton.on('pointerdown', () => {
|
||||||
captureSnapshot(this);
|
// captureSnapshot(this);
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {}
|
function update() {}
|
||||||
|
|
Loading…
Reference in New Issue