Game Development Community

[TD2i 1.3 - Resolved] FPS counter no longer working on iPhone

by Scott Wilson-Billing · in iTorque 2D · 01/06/2010 (10:25 pm) · 2 replies

Hi,

Switched my project to 1.3 fairly painlessly - good work guys! However, I do have a minor problem in that my FPS counter no longer works on the iPhone - it does in the TBG when I run it on the Mac. It worked fine in the beta and I have the update callback flag switched on in my level file.

This is the standard code snippet;

function t2dSceneGraph::onUpdateSceneTick() {
fpsGUICtrl.setText( "FPS:" SPC $fps::real);
}

Any ideas?
Cheers

#1
01/06/2010 (10:30 pm)
Same happen to me.
I'm used this function to display fps:

metrics(fps);

I want to see fps when I testing apps
#2
01/07/2010 (7:10 pm)
For reference, the common folder was cleaned out ALOT. What does this mean?

metrics.cs , and frameOverlayGui are now gone. They still work perfectly fine they are just not in any of the templates. The fix is pretty simple :


(first find it in your older iT2d game common folder)

copy metrics.cs into your game/scripts folder (note i said game, and not common)...

copy frameOverlayGui.gui into the game/gui folder, and go into the game startup code and load these manually.


This means :

function startGame(%level)
{
   Canvas.setContent(mainScreenGui);


This exists currently in game/scripts/game.cs

add the following

exec("~/scripts/metrics.cs");

Just underneath, which should load the frameOverlayGui (you will need to update metrics.cs to point to game/gui/).

Hope this helps , once that is loaded, the normal metrics("fps") will work again, and the FPS overlay should be back