[SOLVED] Center Game on Screen

Good morning! I’ve been searching for a way to center the screen, specifically on mobile devices. The game loads left justified with a huge grey space to the right. Not only on mobile devices, but also when it’s run on a desktop.

I’ve tried the Action “Center the game window on the screen” without any luck and was hoping someone knows another way to accomplish this by editing the index.html or another file from the build?

The game is built with the following settings…

Here are some examples of the grey space to the right of the game…


iPhone 8:

iPhone XR:

Thank you!!

You probably want to use the anchor behavior :wink:

This isn’t exactly a good fix but you can change “Change width to fit screen or window size” to “No changes to game size”

I believe @ninja is right. Making that change will cause your game to be centered with bars on either side. Right now what’s happening is your game is only 1920 wide so when the width is expanding to fill the screen…there’s nothing to show.

However, if you’re wanting your game to adapt to multiple different screen sizes, there are TONS of threads on this you can search for that will be able to help you.

Thanks so much for the responses guys! I was able to fix the issue using Ninja’s suggestion.

Arthuro555’s suggestion also seemed to work but if I took that route, I would have to add the behavior to each object. Not so bad when you’re starting from scratch but when you already have a game made with tons of objects, it could be a bit tedious.

Again, thanks all, changing the post title to SOLVED