Class ResolutionFileResolver

  • All Implemented Interfaces:
    FileHandleResolver

    public class ResolutionFileResolver
    extends java.lang.Object
    implements FileHandleResolver
    This FileHandleResolver uses a given list of ResolutionFileResolver.Resolutions to determine the best match based on the current back buffer size. An example of how this resolver works:

    Let's assume that we have only a single ResolutionFileResolver.Resolution added to this resolver. This resolution has the following properties:

    • portraitWidth = 1920
    • portraitHeight = 1080
    • folder = "1920x1080"

    One would now supply a file to be found to the resolver. For this example, we assume it is "textures/walls/brick.png". Since there is only a single ResolutionFileResolver.Resolution, this will be the best match for any screen size. The resolver will now try to find the file in the following ways:

    • "textures/walls/1920x1080/brick.png"
    • "textures/walls/brick.png"

    The files are ultimately resolved via the given {baseResolver. In case the first version cannot be resolved, the fallback will try to search for the file without the resolution folder.