From fd665f3f83fd90b89884d4435b646c10152f2487 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 22 Mar 2007 19:17:53 +0000 Subject: [PATCH] - Changed to display the text "fps: ", followed by the frame rate to only 2 decimal places. - Size our width accurately. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@179 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/as/com/threerings/flash/FPSDisplay.as | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/flash/FPSDisplay.as b/src/as/com/threerings/flash/FPSDisplay.as index 58b9c4a8..5d6d568f 100644 --- a/src/as/com/threerings/flash/FPSDisplay.as +++ b/src/as/com/threerings/flash/FPSDisplay.as @@ -32,7 +32,8 @@ public class FPSDisplay extends TextField public function FPSDisplay (framesToTrack :int = 150) { background = true; - text = String(Number.MIN_VALUE); + text = "fps: 000.00"; + width = textWidth + 5; height = textHeight + 4; _framesToTrack = framesToTrack; @@ -55,7 +56,7 @@ public class FPSDisplay extends TextField // the difference between 1 frame) var frames :Number = _frameStamps.length - 1; - this.text = String(frames / seconds); + this.text = "fps: " + (frames / seconds).toFixed(2); } /** Timestamps of past ENTER_FRAME events. */