Created
July 19, 2015 09:49
-
-
Save AndreiRudenko/2747c43ce504d61fa815 to your computer and use it in GitHub Desktop.
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
package; | |
import luxe.Text; | |
import luxe.Color; | |
import luxe.Vector; | |
import luxe.Entity; | |
import phoenix.Batcher; | |
class Fps extends Entity { | |
var fps_text : Text; | |
public function new(?_batcher:Batcher) { | |
super({name : "Fps"}); | |
var batcher = _batcher != null ? _batcher : Luxe.renderer.batcher; | |
fps_text = new luxe.Text({ | |
color : new Color(1,1,1,1), | |
pos : new Vector(Luxe.screen.w-90,5), | |
font : Luxe.renderer.font, | |
depth : 100, | |
point_size : 16, | |
batcher : batcher | |
}); | |
} | |
public override function update(dt:Float) { | |
// fps_text.text = 'fps : ' + Math.round(1.0/dt); | |
fps_text.text = 'fps : ' + Math.round(1.0/Luxe.debug.dt_average); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment