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

preloadtex
preloadtex { object  } 

Pre-load the specified texture file from disk into memory. Object  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.

CELX equivalent:

Based on the object:preloadtexture method.


 * Find an object with name  which must be preloaded and store in "objectname".

objectname = celestia:find(  )


 * Preload the texture of "objectname" from disk into memory.

objectname:preloadtexture

Summarized: objectname = celestia:find(  ) 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