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

< Celestia < Celx Scripting < CELX Lua Methods

preloadtex

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.

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

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.