Last active
August 29, 2015 13:59
-
-
Save grabcode/10699964 to your computer and use it in GitHub Desktop.
Snippet adding a surface showing the Famo.us engine FPS - written during Hello Famo.us lesson
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
(function(target, engine, interval) { | |
var surface = new Surface({ | |
size: [50, 35], | |
content: '', | |
properties: { | |
color: 'white', | |
textAlign: 'center', | |
backgroundColor: '#FA5C4F', | |
border: '1px solid black' | |
} | |
}); | |
setInterval(function(){ | |
surface.setContent(Math.round(engine.getFPS())); | |
},interval||1000); | |
target.add(surface); | |
})(device, Engine); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment