M
M
Mokhirjon Naimov2020-04-16 19:27:32
JavaScript
Mokhirjon Naimov, 2020-04-16 19:27:32

How to make a single background (linear gradient) for all Scenes in Phaser 3?

Now on the initial Scene in the create() method I do the following to create a background :

this.background = this.add.graphics();
this.background.fillRect(0, 0, 180, 320);
this.background.fillGradientStyle(0x8e44ad, 0x8e44ad, 0x2980b9, 0x2980b9);

But this only works for the current Scene . How to make a common background (linear gradient) for all Scenes ?
Does Phaser 3 have a ready-made method/solution for this, or can you suggest an elegant solution?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question