How to Scale Down Game Screen Size

Hey everyone,

I currently have a game which looks like this at 1280x720 resolution, and I’d like some ideas on how I should go about scaling down the resolution on smaller screens.

I’m using Libgdx, but I’m not sure whether I should change the camera viewport size or zoom somehow, or change the size of all the sprites so that everything is smaller.

If I change the Libgdx application config screen size (to, say, 800x600), the game works but the player can’t see much to either sides of the player.

Any suggestions or ideas will be greatly appreciated :slight_smile:

Well you could make a method called [icode]scale(float original, boolean useWidth)[/icode] that would take the resolution 1280x720 and get the current resolution and scale it like this (if useWidth is true it’s scaled horizontally otherwise it’s scaled vertically):


public static float scale(float original, boolean useWidth){
    // default resolution
    float defaultWidth = 1280, defaultHeight = 720;
    // get their resolution
    float actualWidth;
    float actualHeight;
    // convert the value
    if(useWidth){
        return original * (actualWidth / defaultWidth);
    } else {
        return original * (actualHeight / defaultHeight);
    }
}

CopyableCougar4 :slight_smile:

Consider utilizing these: https://github.com/libgdx/libgdx/wiki/Viewports