Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Question Regarding Pre-Loading
Started by godonanabt Sep 03 2018 08:14 AM

2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

godonanabt

[GLOBAL: userInfoPane.html]
godonanabt
  • Observer

  • 1 posts
  • Corona SDK

I understand that it is possible to preload textures, but is it possible to preload text?

 

The problem I'm having is that I have a long text (though not so long as to exceed texture memory), which is in a scrollview, but that when I display it, it takes a few moments to display. I was hoping there is some way to display the text without having to recreate it up every time.

 

Finally, which would be considered more efficient: Creating multiple objects of Text, or creating one large object of Text.



[TOPIC: post.html]
#2

dodi_games

[GLOBAL: userInfoPane.html]
dodi_games
  • Contributor

  • 317 posts
  • Corona SDK

Read "Good bye globals" Corona sdk tutorial (Google it)... Make a txt.lua external module... Well organized. And call the texts from that module to the current scene you have the scrollview. Remember to requiere your txt.lua in each scene you are going to use it.

In lua, table and functions are your best friend. I'm still trying to understand it better, cause I'm a newbie like you. If you fell capable to create functions to manage your texts, for example, I think you have a lot of repeated words make a function to handle it four you and focus in the words that are not so common.

DoDi

[TOPIC: post.html]
#3

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 1,878 posts
  • Corona SDK

Yeah you can preload text into objects and reuse them.  But seriously if you have vast amounts of text to display the use HTML and WebView.




[topic_controls]
[/topic_controls]