Skip to content

Instantly share code, notes, and snippets.

@jmjpro
Created April 28, 2013 11:03
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 jmjpro/5476579 to your computer and use it in GitHub Desktop.
Save jmjpro/5476579 to your computer and use it in GitHub Desktop.
{
"libraries": [
"KineticJS"
],
"mode": "javascript",
"layout": "fullscreen mode (vertical)",
"resolution": "reset"
}
<div id="canvas-main"></div>
rect = new Kinetic.Rect({
x: 10,
y: 10,
width: 50,
height: 50,
stroke: 'black'
});
rect.on('click', function(evt) {
this.setX(this.getX()+10);
this.setY(this.getY()+10);
});
layer = new Kinetic.Layer();
stage = new Kinetic.Stage({
container: 'canvas-main',
width: 300,
height: 300
});
layer.add(rect);
stage.add(layer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment