Jump to content

Celestia/Celx Scripting/CELX Lua Methods/CEL command preloadtex

From Wikibooks, open books for an open world

preloadtex

[edit | edit source]

preloadtex { object <string> }

Pre-load the specified texture file from disk into memory. Object <string> is the name of the object who's texture is to be pre-loaded into graphics card memory.

Depending on the file size of the texture being loaded, you may want to follow this command with a wait command. If you are preloading multiple textures, or large textures, you should definitely use a wait command. The wait duration will depend on the size of the texture file(s) and may require some testing to get it just right.

Arguments:

object <string>
The name of the object who's texture is to be pre-loaded into graphics card memory. No default.


CELX equivalent:

Based on the object:preloadtexture() method.

  • Find an object with name <string> which must be preloaded and store in "objectname".
objectname = celestia:find( <string> )
  • Preload the texture of "objectname" from disk into memory.
objectname:preloadtexture()

Summarized:

objectname = celestia:find( <string> )
objectname:preloadtexture()

Example:
This example pre-loads the texture file for Mars:

CEL:

preloadtex { object "Sol/Mars" }

CELX with the object:preloadtexture() method:

mars = celestia:find("Sol/Mars")
mars:preloadtexture()


Back to CEL command index