Skip to content

Instantly share code, notes, and snippets.

View jgranick's full-sized avatar

Joshua Granick jgranick

View GitHub Profile
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 17:15
How to share a Deque object between child threads (NME recipe)
import cpp.vm.Deque;
import cpp.vm.Thread;
import cpp.Sys;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 17:00
How to send messages between child threads (NME recipe)
import cpp.vm.Thread;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
public function new () {
@jgranick
jgranick / ThreadingSample.hx
Created August 24, 2012 16:52
How to send messages to and from a thread (NME recipe)
import cpp.vm.Thread;
import nme.display.Sprite;
import nme.Lib;
class ThreadingExample extends Sprite {
public function new () {
@jgranick
jgranick / TestJS.hx
Created August 9, 2012 18:39
"Hello World" in Haxe/Javascript
class TestJS {
static function main () {
trace ("Hello World");
}
}
@jgranick
jgranick / README.md
Created August 8, 2012 22:44
How to setup Cordova support for NME

Install NME

First, go to http://www.haxenme.org/download and install NME.

Development Builds

Since Cordova support is a beta feature, we will continue to improve NME's support of Cordova over time. If you want, you can get the latest development build here:

@jgranick
jgranick / (Auto-Generated) B2Vec2.hx
Created May 15, 2012 18:23
Initial working example of BuildHX C++ bindings
package box2d.common.math;
#if cpp
import cpp.Lib;
#elseif neko
import neko.Lib;
#end
@jgranick
jgranick / LessVerbose.hx
Created April 16, 2012 16:02
A quick contrast of code styles
class MyCoolClass {
var message:String;
var total:Float;
public function new () {
var hello = combineText ("H", "ello");
var world = combineText ("W", "orld");
@jgranick
jgranick / gist:2031376
Created March 13, 2012 20:33
ObjectHash class (from Actuate)
#if flash
import flash.utils.TypedDictionary;
#end
private class ObjectHash <T> {
#if flash
@jgranick
jgranick / PiratePig.hx
Created February 23, 2012 20:40
Pirate Pig for NME
package com.eclecticdesignstudio.piratepig;
import nme.Assets;
import nme.display.Bitmap;
import nme.display.BitmapData;
import nme.display.Sprite;
import nme.display.StageAlign;
import nme.display.StageScaleMode;
import nme.events.Event;
@jgranick
jgranick / BackButtonExample.hx
Created February 21, 2012 16:14
How to override the back button on Android (NME recipe)
import nme.display.Sprite;
import nme.Lib;
/**
* @author Joshua Granick
*/
class BackButtonExample extends Sprite {