1 decade ago
by empika
Hallo
Any pointers on how I would display the frame rate?
I'm sure I've seen some demo code with this but can't remember where I saw it.
Thanks
1 decade ago
by empika
Again, I asked too quick.
In my main.js
draw: function() {
this.parent();
// display frame rate
var now = (new Date()).getTime();
var delta = now - this.framerateNow;
this.framerateNow = (new Date()).getTime();
this.font.draw( Math.floor(1000/(delta)) + 'fps', 2, 2 );
}
Hopefully someone else will find this useful
1 decade ago
by geradr
thanks empika !
i was cracking my head trying to figure out
how to make a dynamic text on screen like health points
and your post pointed me in the right direction
retrospect, i'm now saying 'duh' to myself
1 decade ago
by SilvRO
(3 years later ...)
And what do you think about this ?
var fps = (1 / ig.system.tick).round();
Idk what geradr was trying to accomplish, but I have all my dynamic (making a mmo) load with the preloader using php from the mysql db's, then store it in a div or span for the UI.
I guess I should just graduate to JSON haha.
Page 1 of 1
« first
« previous
next ›
last »