Skip to content

Instantly share code, notes, and snippets.

@pixelrevision
pixelrevision / PixelPerfectCam.cs
Last active January 26, 2024 05:23
Script for unity to create a pixel locked orthogonal camera
using UnityEngine;
/**
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices.
*/
public class PixelPerfectCam : MonoBehaviour {
/**
* The target size of the view port.
*/
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f);
/**
@Anaphase
Anaphase / coffeescript-class-cheatsheet.coffee
Created September 21, 2015 16:36
CoffeeScript Class Cheatsheet
class ClassName
# shared via closure over constructor
# class and instance functions have access to this variable
privateVariable = 'privateVariable'
# shared via closure over constructor
# not exposed in instance
# doesn't have access to instance
# @ is the window object