New Beta Tester - Corona Cards performance questions

Agreed, I don’t believe this is a storyboard issue. I suspect that widget button very highly :smiley:

Wait.  Hold on.  Are you displaying text in your widget buttons?

I ask because our widget button code internally uses display.newText() to create the text for your button’s “label”.  If your buttons do have labels, then that is the root cause of your performance issue.

Interestingly enough, I’ve noticed that if your button labels are set to an empty string “” or just a space " ", then the performance is considerably worse.

So, how are your buttons set up?

Here is the button I used to test with. There is no text defined, just a two custom images:

local gameModeButton = widget.newButton{ defaultFile = "gameModePuzzle.png", overFile = "gameModePuzzleOver.png", width=100, height=100, onEvent = gameModeButton\_onEvent, x = gameModeX, y = gameModeImageY, }

Okay.  I did notice that there is a much bigger performance hit when the button has no label/text.  I’ll look into resolving that.  Thanks for bringing this up.

The widget buttons are definitely the problem. I made a basic button class myself and replaced the corona widget buttons with my custom buttons and now the page transitions instantly. Something is going on in the widget button that is causing a big delay…

It’s done.  The next CoronaCards version we push out will have a significant speed boost for widget buttons without labels/text.  It also significantly improves the performance of display.newText() without text as well… not that you would really do that (it would end up being an invisible display object), but that was the culprit here.  Thanks for bringing this issue up.

Sounds great, thanks!

Just wanted to give you an update on my app: 

* I’ve replaced all the corona widget buttons on my menu screens with my own. My buttons also support text overlays, but they use a bitmap font now instead of the newText() api so they avoid the performance hit.

* I’ve replaced all my menu screen’s text with bitmap fonts

The app is running very smoothly now! There is pretty much no delay between scene transitions and I am very happy with the results!

I’m hoping to finish making these changes to the main game screens soon. If all goes well it should look and run virtually the same as on iOS and android :smiley:

P.S. I had a little bit of a time adding a bitmap font to corona since I don’t see any direct corona sdk APIs for them. I searched around and found the bmf.lua file contributed by the community and got that working. It does seem to have some glitches in it though and lacks many features. I think it would be an awesome addition to the corona SDK to provide the APIs for bitmap fonts. That way it would have more features and be better tested/less bugs.

Glad to hear that you’re getting fast performance now.  :slight_smile:

Regarding bitmap fonts, the reason we don’t have direct support is partly because we know there are 3rd party libraries that do this and we didn’t want to step on any toes.  Plus, supporting other languages can actually get quite complex.  Such as knowing where to put the word/line-breaks for different languages, supporting Asian languages which have a huge amount of characters, and handling cursive languages such as Arabic.  I do agree that we need some kind of solution for WP8, but we’re not sure what that should be at the moment.

Oh, and in case you didn’t know, here are some other 3rd party bitmap font libraries for Corona that I’m aware of.

TextCandy:

   http://www.x-pressive.com/TextCandy_Corona/features.html

bmGlyph:

   http://www.bmglyph.com/corona-bitmap-font-with-graphics-2-0/

Font-Manager:

   https://github.com/autismuk/Font-Manager