Skip to content

Instantly share code, notes, and snippets.

@grabcode
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grabcode/10699964 to your computer and use it in GitHub Desktop.
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
(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