const progressBar = this.add.graphics(); const progressBox = this.add.graphics(); progressBox.fillStyle(0xF4A391, 0.8); progressBox.fillRoundedRect(this.game.config.width / 2- 218,(this.game.config.height / 2) + 275, 50, 50,25)在该代码的基础上实现一个进度条
时间: 2024-03-27 11:39:25 浏览: 11
好的,根据你提供的代码,我可以为你提供一个基本的进度条实现。代码如下:
```
const progressBar = this.add.graphics();
const progressBox = this.add.graphics();
progressBox.fillStyle(0xF4A391, 0.8);
progressBox.fillRoundedRect(this.game.config.width / 2 - 218, (this.game.config.height / 2) + 275, 50, 50, 25);
const loadingText = this.make.text({
x: this.game.config.width / 2,
y: (this.game.config.height / 2) + 310,
text: 'Loading...',
style: {
font: '20px monospace',
fill: '#ffffff'
}
});
loadingText.setOrigin(0.5, 0.5);
const percentText = this.make.text({
x: this.game.config.width / 2,
y: (this.game.config.height / 2) + 355,
text: '0%',
style: {
font: '18px monospace',
fill: '#ffffff'
}
});
percentText.setOrigin(0.5, 0.5);
const assetText = this.make.text({
x: this.game.config.width / 2,
y: (this.game.config.height / 2) +