youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

White border & UI scaling fixed #52

Closed ghost closed 4 years ago

ghost commented 4 years ago

I seperated the virae from the background image to avoid tearing the background, and made sure the background scales along with the viewport. No more white borders, no more empty screen edges. Resolves #36.

ghost commented 4 years ago

You're right about the colors, I fixed that too, now. Also, I fixed the virae to scale with viewport size so they shouldn't overlap with anything. The layout still breaks for very small window sizes, but since the canvas size will be constant when embedded in the website, this shouldn't be a problem.

I simply forgot about the borders in the scene. Working on it now. I'll try scaling the map along with the viewport as a quick fix, but for the future, I recommend we enable the camera to move along with the player. This would also solve the more profound problem: When the viewport windows is resized during play, the map barriers are not resized with it.

ghost commented 4 years ago

As far as I can see, the blue border only appears when the Unity player is set to "free aspect ratio" and the window is streched very wide. I feel any fix I could write for this would just be extremely dirty.

I also just created a WebGL build, and the problem of map scaling is even more severe in the built version: When starting the game in small window mode and then going fullscreen, the viewport aspect ratio changes and the map barriers are not scaled along with it.

I recommend leaving this as it is right now. In the editor (which only concerns us as developers, anyway), just set the aspect ratio to 16:9 as a workaround. And for the website release, we should disable fullscreen mode for the first version. In the future, we will definitely have to solve this by allowing the camera to move.

holke commented 4 years ago

This looks good in my opinion. The webgl build works with and without fullscreen for me. When starting not full and then going full screen i can see white border stripes on the left and right. But i think they are not too obvious and we can put this into release.

maccxs commented 4 years ago

Hey @FredyHennig, I merged the master which led to merge conflicts in the end scene. I tried to fix them but please check if I haven't overlooked any of your changes. Otherwise: Looks good now.