Stephen Cagle
unread,Oct 12, 2011, 7:28:30 PM10/12/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Paper.js
I have been doing a bit of tinkering with Coffeescript and Paper.js.
No problems until I tried to do animations.
This Coffeescript code,
----------------------------------------------------------------------------------------------------------------------------------------
onFrame = (event) ->
console.log("count:#{event.count} time:#{event.time}
delta:#{event.delta}");
----------------------------------------------------------------------------------------------------------------------------------------
compiles into the following javascript code,
----------------------------------------------------------------------------------------------------------------------------------------
function() {
var onFrame;
onFrame = function(event) {
return console.log("count:" + event.count + " time:" + event.time
+ " delta:" + event.delta);
};
}).call(this);
----------------------------------------------------------------------------------------------------------------------------------------
which gives me a result of... nothing.
I assume onFrame is being detected/discovered in some interesting way.
Some way that Coffeescript has somehow succeeded in hiding from
Paper.js? If this is the case, is there some sort of workaround? Some
way in which I might "manually" inform Paper.js that onFrame is the
animation callback?
Thank you
p.s. In case it matters, I included my html below, the above generated
javascript is the "popper.js" mentioned in the html.
----------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<!-- Load the Paper.js library -->
<script type="text/javascript" src="paper.js"></script>
<script type="text/paperscript" src="popper.js"
canvas="popperCanvas"></script>
<style>
canvas {
width: 1000px;
height: 1000px;
}
</style>
</head>
<body>
<canvas id="popperCanvas"/>
</body>
</html>
----------------------------------------------------------------------------------------------------------------------------------------