how to draw frequently updated data on ios


  • Posts: 19
Hi, I am making an iphone game and can't seem to figure out how to show my frequently updated score on the screen without it lagging. I have tried to just draw the text but that cuts my fps in half. I have also tried the "label for ios" on stencylforge but there seems to be a bug with the code and it never seems to work. Is there a way to show the score on the screen without in lagging in ios? Please help???

This takes a bit of getting right. Took me a while to figure it out. Here's an example game that shows score ticking up using iOS. Let me know if you need help with it.

The trick is to set a local attribute that can be used to check if the score has changed and only update it if it has. Otherwise your frame rate will crash as it tries to update it every frame.

The iOS behaviour included in this game is a modified one that allows you to control multiple text fields with one label. In this case, time and score.

Let me know if there's anything that doesn't make sense!

Good luck


« Last Edit: February 15, 2012, 08:38:15 am by dusker »