0

I have a game based on libgdx that's hosted online.

It runs great on desktop but on mubile it depends on the phone's size.

The game is usually a bit too big and it's quite some trouble to try to make it fit the whole screen.

I have an option to put the game fullscreen, but I'd like for the game to automatically be fullscreen IF it's online AND on a mobile device.

However I haven't found anything to help me with that in libgdx's library, any ideas?

(edit, added code, I didn't show code in the first place because the solution may be in doin php redirection if there's nothing better... then I'd have 2 version of the code, one for desktop and the other one would automatically be fullscreen, for mobile... but having all the source code twice just for an "if" looks overkill to me...)

Here's how I can see wether the game runs on a web page, android or desktop :

(Gdx.app.getType() == ApplicationType.WebGL)

But more then knowing that it's on WebGL, I want to know if the web page ran from a cell phone or tablet or from a desktop.

thanks

Ludovic Migneault
  • 140
  • 1
  • 4
  • 19

0 Answers0