mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add #count to onFrame() event.
This commit is contained in:
parent
4cee442a05
commit
36c9286ca9
1 changed files with 5 additions and 3 deletions
|
@ -154,8 +154,9 @@ var PaperScript = this.PaperScript = new function() {
|
|||
// TODO: Move onFrame support to DocumentView
|
||||
var onFrame = eval('onFrame');
|
||||
if (onFrame) {
|
||||
var lastTime;
|
||||
var totalTime = 0;
|
||||
var lastTime,
|
||||
totalTime = 0,
|
||||
count = 0;
|
||||
function frame(dontSwitch) {
|
||||
if (!dontSwitch)
|
||||
paper = scope;
|
||||
|
@ -168,7 +169,8 @@ var PaperScript = this.PaperScript = new function() {
|
|||
totalTime += delta;
|
||||
onFrame({
|
||||
delta: delta,
|
||||
time: totalTime
|
||||
time: totalTime,
|
||||
count: count++
|
||||
});
|
||||
// Automatically redraw document each frame.
|
||||
if (doc)
|
||||
|
|
Loading…
Reference in a new issue