Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
TextField.new takes too long to load. — Gideros Forum

TextField.new takes too long to load.

rikolousrikolous Member
edited October 2015 in Bugs and issues
I have a page that is taking a long time to load. This page uses ~120 buttons. Which is a lot but surprisingly is not too much. The problem I have is that the first time the page loads it is making all the buttons and each button requires 2 new TextFields. I have timed it and the textfields are what slows it down the most. So the first time the page pops up it downloads 240 TextFields. What ways would you guys get around this? Is there a fast way to maybe duplicate the TextField and then :setText different that the original Textfield and not use TextField.new? Other than that I guess I will just have to make 240 new buttons in paint.net.

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited October 2015
    Do you use TTFonts?
    Try caching symbols there:
    local font = TTFont.new("tahoma.ttf", 30, 
     "ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz")

    Likes: rikolous

    +1 -1 (+1 / -0 )Share on Facebook
  • Thank you. I was using TTFonts but didn't know you could cache symbols. Worked great. Thanks. That'll save me hours upon hours.

    Likes: totebo

    +1 -1 (+1 / -0 )Share on Facebook
  • Its weird it caching works for all my TTFonts on gideros. But when I tried it for my really large sized fonts it wold crash when running through eclipse. When I made those fonts small again it would work fine. The good thing is that I don't need it for those fonts. But I thought I would let you know.
Sign In or Register to comment.