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

< Celestia < Celx Scripting < CELX Lua Methods

cls

cls { }

Clears the display screen of any left-over text that was printed via the print command.
There is no much need to use this command.

The command has no arguments.


CELX equivalent-1:

Based on the celestia:print() method.

celestia:print("")


CELX equivalent-2:

Based on the celestia:flash() method.

celestia:flash("")

Example:
The following example prints text for 5 seconds, but after 2 seconds the display is cleared.

CEL:

print { text "Text to be displayed for 5 sec." row -3 column 1 duration 5 }
wait  { duration 2 }
cls   { }
wait  { duration 3 }

-- OR --

print { text "Text to be displayed for 5 sec." row -3 column 1 duration 5 }
wait  { duration 2 }
print { text "" }
wait  { duration 3 }

CELX-1 with celestia:print() method:

celestia:print("Text to be displayed for 5 sec." , 5.0, -1, -1, 1, 3)
wait(2.0)
celestia:print("")
wait(3.0)

CELX-2 with celestia:flash() method:

celestia:print("Text to be displayed for 5 sec." , 5.0, -1, -1, 1, 3)
wait(2.0)
celestia:flash("")
wait(3.0)

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.