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

< Celestia < Celx Scripting < CELX Lua Methods

print

print { text <textstring> origin <originstring> duration <duration> row <rownumber> column <columnnumber> }

The print command allows you to display text in Celestia's display window, defining where the text is positioned and for how long it should be displayed.

You must follow the print command with a wait command of a duration equal to or greater than the specified <duration> is required.

Beware: If the text you want printed is longer than the width of the user's window, it will run off the right edge of the window.

Arguments:

text <textstring>
The text you want displayed, surrounded by quote marks. No default.
You may also use "\n" to generate a CR/LF at any position within the text string.
origin <originstring>
Starting position of the first character of your text. Default is "bottomleft".
Must be one of the following values:
  • bottom
  • bottomleft
  • bottomright
  • center
  • left
  • right
  • top
  • topleft
  • topright
duration <duration>
Number of seconds to display the text message. Default is 1.0.
row <rownumber>
Defines the starting display line (vertical position), offset from the <originstring>, on which the text should be displayed. Default is 0.
Positive values move the starting row down, while negative values move the starting row up ("+" sign is not necessary).
column <columnnumber>
The column number (horizontal position) where the first character of the text should be displayed. Default is 0.
Column 0 (zero) is the left edge of the display screen.


CELX equivalent-1:

Based on the celestia:flash() method.

Note: This method has no ability to position the text on a specific position on the screen.
The celestia:print() method should be used instead (see CELX equivalent-2)

celestia:flash( <textstring>, <duration> )


CELX equivalent-2:

Based on the celestia:print() method.

celestia:print( <textstring>, <duration>, <horig>, <vorig>, <hoffset>, <voffset> )

Example:
This example prints the message "Hello Universe!" three rows up from the bottom of the display screen, starting two columns from the left edge:

CEL:

print { text "Hello Universe!" row -3 column 2 }
wait  { duration 5 }

CELX with the celestia:flash() method:

celestia:flash("Hello Universe!", 5.0)
wait(5.0)

CELX with the celestia:print() method:

celestia:print( "Hello Universe!", 5.0, -1, -1, 3, 2)
wait(5.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.