View this code at http://livecoding.io/5476579
Created
April 28, 2013 11:03
-
-
Save jmjpro/5476579 to your computer and use it in GitHub Desktop.
created by http://livecoding.io
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"libraries": [ | |
"KineticJS" | |
], | |
"mode": "javascript", | |
"layout": "fullscreen mode (vertical)", | |
"resolution": "reset" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="canvas-main"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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