Occasionally, it can be useful to see how well your animation is performing. Fortunately, there's a built-in performance monitor which displays basic statistics: How many patches are currently visible, how many polygons the patches have been split into, how many frames are being displayed per second, and "straightness" (the render quality setting).
Enabling the display is extremely simple: simply set two properties of the plugin's arcticWindow class during the onCreate() handler:
arctic.window.text = 1; arctic.window.performanceData = 1;
Dynamic enabling/disabling of the code is fairly simple, as well. It can be done easily via a button on the Web page, which (when clicked) calls a function to turn the display on or off:
<script type="text/javascript"> showPerfData = 1; // assumes you're starting with it enabled, as in // the above example. otherwise, set to 0. function TogglePerformanceDisplay() { showPerfData = !showPerfData; arctic.window.text = showPerfData; arctic.window.performanceData = showPerfData; } </script> . . . <form action=""> <div> <input type="button" value="Toggle Info" onClick="TogglePerformanceDisplay();" /> </div> </form>
Warning: The arcticWindow::performanceData property is write-only. Attempting to read the property results in Internet Explorer halting the script (and displaying an error, if directed to by the Internet Options settings).
Note: if no actions are occurring within the window, the results will not be immediately apparent; after clicking the button, you then need to click within the plugin window and drag the mouse in order to make the performance data appear. (If you clicked on the button to disable the display, simply clicking in the plugin window will make the text disappear.)