Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Waiting for TextField.new() to finish. — Gideros Forum

Waiting for TextField.new() to finish.

edited March 2015 in General questions
I have a menu that requires me to build a number of TextField objects before displaying it. Displaying the menu consists of an animated transition from the previous menu to the new one.

Here's the problem. TextField takes a second or so to build everything, which is understandable, but it appears to be building the sprites asynchronously as it pertains to the engine logic while blocking the rendering pipeline. The result being, instead of seeing the animated transitions, I simply see a pause followed by a sudden snap to the new menu with no noticeable transition.

There doesn't seem to be any way to force the engine to wait until TextField is actually done doing its thing. Any ideas?

Edit: I should add that I'm also rendering the TextField objects to RenderTargets before displaying them, but the time it takes to do that is negligible compared to rasterizing the fonts.

Comments

  • piepie Member
    @FlimFlamboyant you can cache your font on TTFont init to rasterize it once, before you need it to do something (cached fonts are the same as bitmap fonts as far as I know).

    about the speed issue -if I understood correctly I had a similar "lag" - I would try to use some timers, to call textfields one after another. Maybe just 100 ms of delay between each call is enough.



  • Its my solution.
    Create TextFields.
    setVisible to false.
    add to stage.
    whenever you need setVisible to true
    start transition or animation or something else.
Sign In or Register to comment.