var progressBox = this.add.graphics();
progressBox.fillStyle(0x222222, 0.8);
progressBox.fillRect(240, 270, 320, 50);
I have this. As you can see , i provided 240,270 as x,y. But i want it to be centered exactly depending on the user’s device’s screen’s sizes.
What should I do? get the device screen sizes via javascript and pass them to this function ? or any other ideas?