Celestia/Celx Scripting/CELX Lua Methods/CEL command mark
mark
editmark { 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).
- Find an object with name <objectstring> which must be marked and store in "objectname".
objectname = celestia:find( <objectstring> )
- Mark the specified object.
celestia:mark( objectname )
Summarized:
objectname = celestia:find( <objectstring> ) celestia:mark( objectname )
CELX equivalent-2:
Based on the object:mark() method.
- Find an object with name <objectstring> which must be marked and store in "objectname".
objectname = celestia:find( <objectstring> )
- Place a marker on "objectname", according the specified parameters:
- <colorstring>: The color to be used for the marker. Default is lime.
- Either use HTML-style hex color strings such as “#00ff00” (lime),
or some predefined color names like: "red", "green", "yellow", "blue", "white", "black", etc..
A list of supported color names can be found on the HTML Color Names page.
- Either use HTML-style hex color strings such as “#00ff00” (lime),
- <symbolstring>: Name of symbol to be used for the marker. Default is "diamond".
The available marker symbols are:- "diamond", "triangle", "square", "plus", "x", "filledsquare",
"leftarrow", "rightarrow", "uparrow", "downarrow", "circle", "disk".
- "diamond", "triangle", "square", "plus", "x", "filledsquare",
- <sizenumber>: Size of the marker in pixels. Default is 10.
- <opacitynumber>: A value from 0 to 1 that gives the opacity of marker. The Default is 1.0, completely opaque.
- <labelstring>: A text label which can be added to the marker. The default is the empty string, indicating no marker label.
- <boolean_occludable>: A boolean flag indicating whether the marker will be hidden by objects in front of it. The default is true !!!
Note: In previous Celestia releases (version 1.5.1 and older), the marker was NOT hidden by objects in front of it, which is NOT the default in Celestia version 1.6.0 and later !!!
Note: Using <boolean_occludable> in Celestia version 1.5.1 and older, will result in a Celestia error !!!
- <colorstring>: The color to be used for the marker. Default is lime.
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)