Skip to content

Instantly share code, notes, and snippets.

@Neurogami
Created March 5, 2013 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neurogami/5094473 to your computer and use it in GitHub Desktop.
Save Neurogami/5094473 to your computer and use it in GitHub Desktop.
Sample code from v2 of Leap Web game
function prepareLeap(){
canvas = document.getElementById("gameCanvas");
context = canvas.getContext("2d");
controller = new Leap.Controller();
var leftX = parseInt($('#leftX').val());
var rightX = parseInt($('#rightX').val());
var bottomY = parseInt($('#bottomY').val());
var topY = parseInt($('#topY').val());
region = new Leap.UI.Region([leftX, bottomY, -100], [rightX, topY, 300])
controller.addStep(new Leap.UI.Cursor())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment