I can see that. I'm
literally heavily invested in Unity though, so I went round the houses looking for solutions to these kinds of seemingly simple issues.
In case you come back to Unity, or in case anyone else is looking for solutions to the elusive pixel snapping issue, here's my incredibly simple take.
1: Create a shader file and copy-paste this in using your code editor:
https://gist.github.com/talecrafter/81e2f3bb7fb4b4fc367e7b851772b6462: Create a material file and apply the shader using the selector in the inspector. Set your "Pixels Per Unit" in here as well. (I use 1 for simplicity and it's great.)
3: Apply to any SpriteRenderer components (attached to any game objects) you want to pixel snap. This is pretty crazy. If you zoom in the editor, you'll see game objects snapping around when you try to move them by sub-pixel values.
5: Now for the camera. It doesn't use a sprite renderer and applying a shader to the whole screen is not a great idea. So the answer is simple: create a script for it and copy-paste this in:
public class PixelSnap : MonoBehaviour
{
private Vector3 _tempPosition;
private void LateUpdate()
{
_tempPosition = transform.position;
transform.position =
new Vector3(
Mathf.RoundToInt(transform.position.x),
Mathf.RoundToInt(transform.position.y),
transform.position.z);
}
private void OnRenderObject()
{
transform.position = _tempPosition;
}
}
This assumes a "Pixels Per Unit" of 1, but the maths is pretty trivial to update even if you're running at 16 or 32. (Feel free to shout if you need help.)
And that's it. Camera movements snap to pixels. If you want a pixel art game with non-pixel-art UI, just don't apply the pixel snap material to your UI components. If you want game objects to move together, put one as a parent of the other apparently (untested in my game.)
What this doesn't do is limit the screen to old console game dimensions, force game pixels to be multiples of screen pixels and introduce borders or black bars. So I probably have some issues ahead of me still...
(Admin/mods, if you want me to move this to general, just shout.)
I will have a look at Gamemaker Studio and that video, but I don't speak German!