-
-
Save ruby0x1/effb9014eb0de75b64c5 to your computer and use it in GitHub Desktop.
Simple FPS Text instance, modified from @RudenkoArt as an example for http://luxeengine.com
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.Log.*; | |
import luxe.options.TextOptions; | |
class FPS extends Text { | |
public function new( ?_options:luxe.options.TextOptions ) { | |
def(_options, {}); | |
def(_options.name, "fps"); | |
def(_options.pos, new Vector(Luxe.screen.w - 5, 5)); | |
def(_options.point_size, 14); | |
def(_options.align, TextAlign.right); | |
super(_options); | |
} //new | |
public override function update(dt:Float) { | |
// text = 'fps : ' + Math.round(1.0/dt); | |
text = 'FPS : ' + Math.round(1.0/Luxe.debug.dt_average); | |
} //update | |
} //FPS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment