Search tips
  • AS3 FPS Counter | kaioa.com
    package{ import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.utils.getTimer; public class FPSCounter extends Sprite{ private var last:uint = getTimer(); private var ticks:uint = 0; private var tf:TextField; public function FPSCounter(xPos:int=0, yPos:int=0, color:uint=0xffffff, fillBackground:Boolean=false, backgroundColor:uint=0x000000) { x = xPos; y = yPos; tf = new TextField(); tf.textColor = color; tf.text = "----- fps"; tf.selectable = false; tf.background = fillBackground; tf.backgroundColor = backgroundColor; tf.autoSize = TextFieldAutoSize.LEFT; addChild(tf); width = tf.textWidth; height = tf.textHeight; addEventListener(Event.ENTER_FRAME, tick); } public function tic
    in Tutorial > Actionscript > Actionscript 3 with fps frame per rate second


per from all users