This method is especially useful to save all renderflags at the beginning of a script, so these values can be reset at script end or script termination, by using the function celestia_cleanup_callback().Įxample: actual_renderflags = celestia:getrenderflags()Ĭelestia:setrenderflags( table:renderflags).Return a table with all known renderflags (see celestia:setrenderflags() method) as keys, and a boolean as value indicating whether a specific renderflag is enabled or disabled. Multiple features can be enabled at once by giving multiple arguments to this method, separated by a comma.Renderflag String describing the render-feature to be disabled. The duration of wait () must be at least equal to that of print () method.Ĭelestia:flash( string:text ) Note: the duration of the celestia: print method is contained in the duration of the wait method which follows it.The two do not add up. Rmars = celestia:find("Sol/Mars"):radius()Ĭelestia:print("Earth radius is: ". Rearth = celestia:find("Sol/Earth"):radius() Print on more than 1 line and use text and variables: voffset Vertical Offset relative to origin.Ĭelestia also has the possibility to set the text color prior to this method, using the 1.6.1 celestia:settextcolor() method.Ĭelestia:print("Middle", 3.0, 0, 0, -3, 0)Ĭelestia:print("Bottom left", 3.0, -1, -1, 2, 4)Ĭelestia:print("Top right", 3.0, 1, 1, -10, -4) horig Horizontal origin of the text, -1 is left, 0 center, 1 right vorig Vertical origin of the text, -1 is bottom, 0 center, 1 top hoffset Horizontal offset relative to origin. Negative duration values are considered to be 1.5 seconds. duration Number of seconds the text is shown. variable2įor the more experienced CELX writer, it’s also possible to use Lua string functions on text, for instance to merge and format text and variables (see Lua Reference Manual).
This can be done by concatenating text strings and variables as follows: It is also possible to use variables and text strings within the same print command. The string can contain newlines "\n" to break lines, or many special characters encoded in UTF-8. Text A string containing the message to be printed. Celestia supports UTF-8 encoded text strings for showing non-ASCII characters. This chapter contains a list of all available celestia methods, which can be used on the predefined celestia object.Ĭelestia:print( string:text ) This object is predefined and gives access to all the celestia-related functionality available for Lua-scripts, either directly by methods of celestia, or indirectly by creating other objects which offer more functionality. Celx Scripting: Celestia object celestia