Guys, I hope you are well.
I’m trying to get my game inside the mobile screen, but it’s becoming a cumbersome task. I’m using Cordova and the code to adjust the screen size is
I intend to configure the hud only for android and another for pc, but I don’t want to use the style because it distorts the image. I just need to make the screen size fullscreen and then I’ll position everything related to the center.
The big problem is that the game goes beyond the limits of mobile.
If anyone can give me a hint, I’d be grateful.
1 step was to understand that cell phones have a pixel compression rate and to identify it I used “window.devicePixelRatio” so I just used “window.innerWidth” to capture the amount of pixel and divide by the compression, that’s it! I have the necessary size to draw the scenery!