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
<html> | |
<head> | |
<title>Pt - getting started</title> | |
<script type="text/javascript" src="http://williamngan.github.io/pt/dist/pt.min.js"></script> | |
</head> | |
<body> | |
<div id="pt" style="width: 500px; height: 500px;"></div> | |
<script type="text/javascript"> |
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
<script type="text/javascript"> | |
// Our exciting code | |
space = new CanvasSpace("#pt") | |
</script> |
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
<script type="text/javascript"> | |
// Our exciting code | |
space = new CanvasSpace("#pt").setup( {bgcolor: "#f1f1f1"} ) | |
</script> |
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
<script type="text/javascript"> | |
// Our exciting code | |
space = new CanvasSpace("#pt").setup( {bgcolor: "#f1f1f1"} ) | |
form = new Form(space) | |
dot = new Point( 250, 250 ) | |
bot = { |
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
<script type="text/javascript"> | |
// Our exciting code | |
space = new CanvasSpace("#pt").setup( {bgcolor: "#f1f1f1"} ) | |
form = new Form(space) | |
</script> |
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
<script type="text/javascript"> | |
// Our exciting code | |
space = new CanvasSpace("#pt").setup( {bgcolor: "#f1f1f1"} ) | |
form = new Form(space) | |
dot = new Circle( 250, 250 ).setRadius( 50 ) | |
bot = { |
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
<script type="text/javascript"> | |
// Previous code omitted ... | |
bot = { | |
animate: function( time, fs, context ) { | |
form.fill( "#999" ) | |
form.text( new Point( 20, 20 ), "frame rate is "+(1000/fs) ) | |
form.fill( "#5AF" ).stroke( false ) |
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
<script type="text/javascript"> | |
// Previous code omitted ... | |
another = new Circle( 100, 100 ).setRadius( 50 ) | |
bot = { | |
animate: function( time, fs, context ) { | |
// Previous code omitted ... | |
form.fill( false ).stroke( "#fc0", 5 ) |
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
<script type="text/javascript"> | |
// Previous code omitted ... | |
bot = { | |
animate: function(time, fs, context) { | |
// Previous code omitted ... | |
}, | |
onMouseAction: function(type, x, y, evt) { | |
// Code to track mouse actions will go here |
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
<script type="text/javascript"> | |
// Previous code omitted ... | |
bot = { | |
animate: function(time, fs, context) { | |
// Previous code omitted ... | |
}, | |
onMouseAction: function(type, x, y, evt) { | |
if (type == "move") { |
OlderNewer