Home

Awesome

GitHub release  Platform  GitHub issues  GitHub license  Code of Conduct 

⚡️PLEASE NOTE: THIS REPO IS NO LONGER BEING ACTIVELY UPDATED.

DeadSimple Pixel-Perfect Camera

The DeadSimple pixel-perfect camera is an easy-to-use orthographic camera script for producing crisp, clean pixel art at any resolution in Unity.

Art by Buch—http://opengameart.org/users/buch or Patreon.com https://www.patreon.com/buch.

What This Script Does (and Doesn't)

This script will make sure your pixel art looks pretty at any screen size—in other words, every pixel in your original artwork will be displayed at the same size as every other pixel, so you won't get any weird non-square pixels/blobs (blech.)

What this script won't do is force your character sprites to only move in single-pixel increments. That is a function more suited to your controller.

Installation

Fork or download this repository to your local machine, then either load up the sample project in Unity (and the Example scene,) or simply drag the DSPixelPerfectCamera.cs file onto the orthographic camera in your current project. Then:

Importing Art

In order to produce perfect pixel art, you need to import your artwork with the proper settings. If you don't, this camera script won't be of much use. In your sprite's inspector, make sure it's set-up for:

Other Required Settings

To view your scene in pixel-perfect fashion in the Unity Editor, make sure you have Maximize on Play enabled. Anything that causes your scene to be rendered at other than 100% of the screen settings you've selected, will cause your artwork to look wonky in the Editor.

By the same token, you will want to turn off Default is Full Screen in the player settings of your build; otherwise, when you boot your standalone game its display will be stretched-to-fit, ruining the hard work you put into your pixel art.

Questions? Drop Us a Line!

Contact

License

The DSPixelPerfectCamera.cs script is distributed under the MIT license. See LICENSE for more information.

All artwork included in this repository is for example only, and is copyright Michele Bucelli. You can find more of Buch's great artwork at OpenGameArt.org http://opengameart.org/users/buch, or Patreon.com https://www.patreon.com/buch.

Thanks for using DeadSimple Pixel-Perfect Camera!

<!-- Badge References --> <!-- URL References -->