Search code examples
processingscreen-resolution

switching between devices in processing 3 changes how things look


I'm using processing 3 to make my game and I have a major issue where the game looks completely different when running on a different device. The two devices have different resolutions which might be the problem. How do I fix this? Here is a picture of how it looks when I run it on my device: https://i.sstatic.net/XNDGY.png Here is a picture of how it looks when I run it on my friend's device: https://i.sstatic.net/cJ80S.jpg


Solution

  • If the two screens have a different resolution and the buttons sometimes overlap, then I'm guessing the following are both true:

    • Buttons are constant width
    • Buttons positions are based on fraction of screen width -- not an absolute position

    If you want to display the buttons at smaller resolutions and maintain gaps between them, you'll have to also scale the button widths (and height) based on the current resolution.