VirusGame icon indicating copy to clipboard operation
VirusGame copied to clipboard

Window too large

Open BLiu1 opened this issue 4 years ago • 6 comments

I ran the program on Processing and the window was too big for my 13" MacBook Pro.

Workaround: change display settings and scale everything down.

BLiu1 avatar Aug 16 '20 05:08 BLiu1

I'm having the same problem. How do you change the display settings to scale everything down?

sleepybraincells avatar Aug 16 '20 06:08 sleepybraincells

Hello everyone! I don't know an easy solution for this, but a quick workaround I've found is this:

Find the line that says "void draw(){" Then, add a line directly below it that says scale(0.5);

...now, run it. It should scale all the graphics down by 50%! The only problem is, I think the mouse controls are still looking for the larger-screen-coordinates :(

I guess what I should've done is not hard-coded in the the window resolution and UI-dimensions to be such a weird resolution (1728 by 972 is very strange).

carykh avatar Aug 16 '20 06:08 carykh

I did a pull request with carykh's workaround but I solved the mouse looking for larger-screen-coordinates too

A11v1r15 avatar Aug 16 '20 17:08 A11v1r15

I'm having the same problem. How do you change the display settings to scale everything down?

On macOS, go to your System Preferences > Displays > toggle Scaled > click More Space (all the way to the right). Windows and Linux should have something similar to adjust the scale of the display.

BLiu1 avatar Aug 16 '20 20:08 BLiu1

if you go to line 61 (you can see what line you are on on the left side of the window) there should be a bit of code that looks like this size(1728,972) if you find the size of ur screen in pixels and replace the numbers it will change the size of the game so you can fine tune it to ur screen size

Craftingnerf avatar Aug 20 '20 22:08 Craftingnerf

I have a working solution but it's not easy.

  1. Change the size(1728,972); on line 61 to fullScreen(); (or i window size you like i don't care)
  2. Go to line 44 and and float scalefactor; on the next line
  3. Go to line 62 and insert scalefactor = (float)width/1728; on the next line
  4. Go to line 98 and insert scale(scalefactor); on the next line
  5. Lastly, change every occurrence of mouseX and mouseY to (mouseX/scalefactor) and (mouseY/scalefactor) respectively.

Conando025 avatar Sep 05 '20 15:09 Conando025