A couple of Celx PRINT functions
Posted: 18.04.2004, 09:21
.
[April 18, 2004 ... Updated to version 1.1: Changed printTime to displayTime. Just seems better.]
Don G's Celx PRINT functions for Celestia (Version 1.1)
The script code: (http://www.donandcarla.com/Celestia/celx_scripting/PrintFunctions_1-1.celx.txt)
My Celestia page: (http://www.donandcarla.com/Celestia/)
The code in this Celx script provides easy-to-use print functions that you can use in your own Celx scripts, and is provided FREE with NO STRINGS ATTACHED by Don G. The print functions include:
displayTime
...Determine the number of seconds to display text, based on the SEC_PER_CHAR global variable.
textWrap
...Determines where line feeds need to be inserted, based on the CHARS_PER_LINE global variable, and inserts them.
printLL
...This print function does several things:
Enjoy!
[April 18, 2004 ... Updated to version 1.1: Changed printTime to displayTime. Just seems better.]
Don G's Celx PRINT functions for Celestia (Version 1.1)
The script code: (http://www.donandcarla.com/Celestia/celx_scripting/PrintFunctions_1-1.celx.txt)
My Celestia page: (http://www.donandcarla.com/Celestia/)
The code in this Celx script provides easy-to-use print functions that you can use in your own Celx scripts, and is provided FREE with NO STRINGS ATTACHED by Don G. The print functions include:
displayTime
...Determine the number of seconds to display text, based on the SEC_PER_CHAR global variable.
textWrap
...Determines where line feeds need to be inserted, based on the CHARS_PER_LINE global variable, and inserts them.
printLL
...This print function does several things:
- * If seconds is not provided, determines how long the text should be displayed (in seconds).
* Counts the number of lines of text to be displayed.
* Counts up from the bottom of the display to determine what line to start printing on.
* Print the text in the lower left-hand corner of the display, using the HORIZONTAL_OFFSET global variable to determine how many characters from the left edge of the display to begin at.
Code: Select all
Use printLL and specify the duration yourself...
printLL("Hello, my name is Don.", 5)
Code: Select all
Use printLL without passing a duration value (the function will compute one on it's own), with user-specified line-breaks...
printLL("This is a line of text.\nThis is a second line of text.\nThis is a third line of text.")
Code: Select all
Use printLL and textWrap...
printLL( textWrap("This is a lot of text, to demonstrate the textWrap and printLL functions. Earth is the third 'rock' from the sun and has a lot of man-made satellites and space junk orbiting around it.") )
Code: Select all
Use displayTime only...
text = "This is a line of text.\nThis is a second line of text.\nThis is a third line of text."
seconds = displayTime(text)
celestia:print(text, seconds, -1, -1, 0, 10)
wait(seconds)
Code: Select all
Use displayTime and textWrap...
myText = textWrap("This is a lot of text, to demonstrate the textWrap and printLL functions. Earth is the third 'rock' from the sun and has a lot of man-made satellites and space junk orbiting around it.")
seconds = displayTime(myText)
celestia:print(myText, seconds, -1, -1, 0, 10)
wait(seconds)
Enjoy!