r/Unity2D•
psoshmo

question about resolution

Question

I am hoping this is a simple question and I am just being stupid. I am attempting to make a pixel art game using 16x16 sprites. I would like the resolution to be lower so that you can see the actual pixels (320x240 maybe?).

When I switch the resolution to something small like that, the view in the "game" screen gets tiny. Is there a way to have low resolution but still make it take up the screen?

or is there a way to scale my sprites larger so something like 1 pixel gets scaled up to 4? Im open to suggestions

FYI: my ppu is 16 and Ive been setting my orthographic camera size to (vert res / ppu) x 0.5

thanks a bunch

Posted Sep 19, 2017, 7:05 PM UTC

24
eric_stasis•

I'm not at my home computer, so I don't remember the exact name of this property, but if you go and click on your image file that your sprites come from, you can set the pixels per unit for that image in the inspector window. Setting it lower makes the image bigger, and setting it higher makes it smaller.

So, if you want each pixel to be 4 times their normal size, set the pixels per unity on that image to be 25, and then click Apply.

Edit: This is assuming your pixels per unit on the image are all set at the default 100. If you want it to be 4 times bigger than whatever you've got set, then set it to: Your-PPU-Number / 4

1
psoshmoOPBeginner•

Maybe Im not explaining myself well, but I dont think the problem is with my ppu. Its that the game screen gets tiny when I put it to a lower resolution. So I am trying to find a way to keep it full screen but just at a lower resolution, if that makes any sense

1
eric_stasis•

Ahh, if you want it to be 320x240, but also run in full-screen, then try adding this code:

Screen.SetResolution(320, 240, true);

The 'true' should force it into full-screen mode

You can just make a script to set the resolution and put that in the Start() function and even make the width and height into variables to make testing it easier.

1
Tatos_•

Another way to achieve this could be resampling the game in a Render Texture of 320x240 using Render to Texture in the camera. And then drawing it in the canvas within a Raw Image , this will allow you to use other resolutions keeping the pixels under control.

1