Skip to content

Instantly share code, notes, and snippets.

View alecmce's full-sized avatar

Alec McEachran alecmce

View GitHub Profile
@jgranick
jgranick / MineHX.hx
Created February 7, 2012 21:24
How to switch graphics based on screen density (NME recipe)
package com.eclecticdesignstudio.minehx;
import nme.display.Sprite;
import nme.system.Capabilities;
import nme.Assets;
/**
* ...
var list:Vector.<Point> = new Vector.<Point>();
list[0] = new Point(1, 1);
list[1] = new Point(-1, 1);
list[2] = new Point(-1, -1);
list[3] = new Point(1, -1);
var polygon:Polygon = new Polygon(list);
// INTERPRETATION 1:
// polygon is defined by vertices and represents a square the sides of which lie parallel