Adding game score display - live text or bitmap digits?

I have got to the stage where I want to add some score display to my game and I wanted to ask for advice on whether it is recommended to use live text for this or to knock out a set of digit pngs and display the score using graphics.

My game has a lot going on so I want to ensure I do the scoring in the most optimised way.

Any advice much appreciated.

Thanks

Paul [import]uid: 7863 topic_id: 2745 reply_id: 302745[/import]

I think it’s a given that text will perform better than images. However in it’s current state where it does not render in full res for the iPhone 4, I would not be happy to use text at a lower quality.

// red. [import]uid: 7143 topic_id: 2745 reply_id: 8229[/import]

Ah thanks red - I wasn’t sure if text or images would be better. I recall from my days of developing games using other tools that images were better.

Quick question which I am sure I could find the answer on the Corona site. If I use text, can I use any font I want? And can I embed just the characters I need or does it embed the entire font set?

Thanks

Paul [import]uid: 7863 topic_id: 2745 reply_id: 8230[/import]

Here is all the info you need on custom fonts: http://developer.anscamobile.com/content/display-objects#Using_a_custom_font

It works really well :slight_smile:

// red. [import]uid: 7143 topic_id: 2745 reply_id: 8232[/import]

Don’t know the exact answer for Corona SDK, but don’t be sure that text objects are performing better than premade texture digits. For Cocos2d the *second* approach actually gives much better results. I would think the same applies for Corona too, since both of them rely on OpenGL.

http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:labels [import]uid: 7356 topic_id: 2745 reply_id: 8233[/import]

Hehe now you have me confused as to which to choose. I guess there is no harm in giving each method a go and see if there is any difference.

Thanks for the advice. I will report back with my findings.

Paul [import]uid: 7863 topic_id: 2745 reply_id: 8234[/import]

Would you suggest making a movie clip of the 10 digits (0 - 9) and then displaying 6 copies of this movie clip assuming the score display has 6 digits? Or is there a better way to do this?

[code]

local digit1Anim = movieclip.newAnim{ “digit0.png”, “digit1.png”, “digit2.png”, “digit3.png”, “digit4.png”, “digit5.png”, “digit6.png”, “digit7.png”, “digit8.png”, “digit9.png” }

digit1Anim.x = 40
digit1Anim.y = 40
local digit2Anim = movieclip.newAnim{ “digit0.png”, “digit1.png”, “digit2.png”, “digit3.png”, “digit4.png”, “digit5.png”, “digit6.png”, “digit7.png”, “digit8.png”, “digit9.png” }

digit2Anim.x = 84
digit2Anim.y = 40

local digit3Anim = movieclip.newAnim{ “digit0.png”, “digit1.png”, “digit2.png”, “digit3.png”, “digit4.png”, “digit5.png”, “digit6.png”, “digit7.png”, “digit8.png”, “digit9.png” }

digit3Anim.x = 128
digit3Anim.y = 40

local digit4Anim = movieclip.newAnim{ “digit0.png”, “digit1.png”, “digit2.png”, “digit3.png”, “digit4.png”, “digit5.png”, “digit6.png”, “digit7.png”, “digit8.png”, “digit9.png” }

digit4Anim.x = 172
digit4Anim.y = 40

local digit5Anim = movieclip.newAnim{ “digit0.png”, “digit1.png”, “digit2.png”, “digit3.png”, “digit4.png”, “digit5.png”, “digit6.png”, “digit7.png”, “digit8.png”, “digit9.png” }

digit5Anim.x = 216
digit5Anim.y = 40
local digit6Anim = movieclip.newAnim{ “digit0.png”, “digit1.png”, “digit2.png”, “digit3.png”, “digit4.png”, “digit5.png”, “digit6.png”, “digit7.png”, “digit8.png”, “digit9.png” }

digit6Anim.x = 260
digit6Anim.y = 40

[/code] [import]uid: 7863 topic_id: 2745 reply_id: 8238[/import]

@mediakitchen

Nice implementation, but since you do this for performance reasons, I would go with spritesheets. [import]uid: 7356 topic_id: 2745 reply_id: 8240[/import]

I am using the Standard SDK - not the Game Edition for my game as I am writing all the physics myself so I believe sprite sheets are not available.

[import]uid: 7863 topic_id: 2745 reply_id: 8241[/import]

I see… Your implementation seems ok to me then. I have seen a similar implementation for Zombieville USA which was made in Unity3d. So, I suppose you are on the right way… [import]uid: 7356 topic_id: 2745 reply_id: 8242[/import]

That sounds good enough to me Magenda and performance seems OK too.
Thanks
Paul [import]uid: 7863 topic_id: 2745 reply_id: 8244[/import]

If you are working on high performance android game, then use images for text. Just setting the text of a newText object alone will get you hunted by the Dalvik Garbage Collector faster when you can run. Actually on my Google G1 (HTC Dream) the simple print of the FPS rate will drag the framedelta down from around 16-18 millisecs to 200-300 millisecs. :slight_smile: [import]uid: 5712 topic_id: 2745 reply_id: 8285[/import]

Im trying to use the score you have supplied but the problem im unable to read the file or write to it.
Any suggestions?

One more question, why do you use the scList = score.newList(1) and what is the benefit of using the list here what it will help in

Im really confused

Thanks [import]uid: 11038 topic_id: 2745 reply_id: 11004[/import]