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

< Celestia < Celx Scripting < CELX Lua Methods

mark

mark { object <objectstring> size <sizenumber> color <colorvector> symbol <symbolstring> label <labelstring> occludable <boolean_occludable> }

This command marks the <objectstring> with the specified <symbolstring> of the specified <sizenumber> and <colorvector>. It is also possible to add a label <labelstring> to the marker and define whether the marker will be hidden by objects in front of it.


Arguments:

object <objectstring>
Name of the object to be marked. No default.
size <sizenumber>
Diameter, in pixels, of the symbol. Default is 10.0.
color <colorvector>
Defines the color of the symbol. Default is [1 0 0] is red.
The three number values define the strength of Red, Green and Blue (RGB) respectively. Allowable values are from 0 to 1, with decimals being specified with a leading 0, such as 0.5. Any value over 1 is handled the same as if it were specified as 1.
symbol <symbolstring>
Defines what shape of symbol to mark the object with. Default is "diamond".
Must be one of the following string values:
  • diamond
  • plus
  • square
  • triangle
  • x
  • 1.6.0 filledsquare
  • 1.6.0 leftarrow
  • 1.6.0 rightarrow
  • 1.6.0 uparrow
  • 1.6.0 downarrow
  • 1.6.0 circle
  • 1.6.0 disk
1.6.0 label <labelstring>
A text label for the marker. The default is the empty string, indicating no label.
1.6.0 occludable <boolean_occludable>
A boolean flag (true|false) indicating whether the marker will be hidden by objects in front of it. The default is true, the marker will be hidden by objects in front of it.


CELX equivalent-1:

Based on the celestia:mark() method.

Note: It is NOT possible with this method to define the size, color, symbol, label and occludability of the marker.
The object:mark() method should be used instead (see CELX equivalent-2).


objectname = celestia:find( <objectstring> )
celestia:mark( objectname )

Summarized:

objectname = celestia:find( <objectstring> )
celestia:mark( objectname )


CELX equivalent-2:

Based on the object:mark() method.

objectname = celestia:find( <objectstring> )
objectname:mark( <colorstring>, <symbolstring>, <sizenumber>, <opacitynumber>, <labelstring>, <boolean_occludable> )

Summarized:

objectname = celestia:find( <string> )
objectname:mark( <colorstring>, <symbolstring>, <sizenumber>, <opacitynumber>, <labelstring>, <boolean_occludable> )

Example:
The following example marks the Earth with a green "x" and (1.6.0) a label "This is our Earth", that will stay visible when objects pass in front of it.

CEL:

# In previous Celestia releases (version 1.5.1 and older).
mark { object "Sol/Earth" size 15 color [0 1 0] symbol "x" }
# In newer Celestia releases (version 1.6.0 and later).
mark { object "Sol/Earth" size 15 color [0 1 0] symbol "x" label "This is our Earth" occludable false }

CELX with the celestia:mark() method not completely compatible:

-- This example will NOT meet the required size, color and symbol !!!
objectname = celestia:find("Sol/Earth")
celestia:mark(objectname)

CELX with the object:mark() method:

-- In previous Celestia releases (version 1.4.1 and older).
objectname = celestia:find("Sol/Earth")
objectname:mark("green", "x", 15.0, 1)
-- In previous Celestia releases (version 1.5.0 and 1.5.1).
objectname = celestia:find("Sol/Earth")
objectname:mark("green", "x", 15.0, 1, "This is our Earth" )
-- In newer Celestia releases (version 1.6.0 and later).
objectname = celestia:find("Sol/Earth")
objectname:mark("green", "x", 15.0, 1, "This is our Earth", false)


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.