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

From Wikibooks, open books for an open world
Jump to navigation Jump to search

labels[edit]

labels { set|clear <labelflagsstring> }

Set (turn on) or clear (turn off) labeling of one or more items.

Arguments:

set <labelflagsstring> -- OR -- clear <labelflagsstring>
The set or clear string values can be any combination of the items listed below. No default.
Multiple values are specified within a single set of quotes ("...") by separating them with a space or vertical bar "|" (i.e. "moons|stars"):
  • asteroids
  • comets
  • constellations
  • 1.6.0 dwarfplanets
  • galaxies
  • 1.6.0 globulars
  • 1.5.0 i18nconstellations
    • used to display either the Latin or the translated label names of constellations when the labeling of constellations is enabled.
  • locations
  • 1.6.0 minormoons
  • moons
  • 1.5.0 nebulae
  • 1.5.0 openclusters
  • planets
  • spacecraft
  • stars


CELX equivalent-1:

Based on the celestia:hidelabel() and celestia:showlabel() methods.

  • Enable labeling with celestia:showlabel( <labelflagstring> ) method.
    <labelflagstring> describes the type of labels to enable.
    Multiple label types can be enabled at once by giving multiple arguments to this method, separated with a comma ",".
    Must be one of:
    • planets, moons, spacecraft, asteroids, comets, stars, galaxies,
      locations, constellations, 1.5.0 i18nconstellations, 1.5.0 openclusters, 1.5.0 nebulae,
      1.6.0 dwarfplanets, 1.6.0 minormoons, 1.6.0 globulars.
celestia:showlabel( <labelflagstring> )
  • Disable labeling with celestia:hidelabel( <labelflagstring> ) method.
    <labelflagstring> describes the type of labels to disable.
    Multiple label types can be disabled at once by giving multiple arguments to this method, separated with a comma ",".
    Must be one of:
    • planets, moons, spacecraft, asteroids, comets, stars, galaxies,
      locations, constellations, 1.5.0 i18nconstellations, 1.5.0 openclusters, 1.5.0 nebulae,
      1.6.0 dwarfplanets, 1.6.0 minormoons, 1.6.0 globulars.
celestia:hidelabel( <labelflagstring> )


CELX equivalent-2:

Based on the celestia:setlabelflags() method.

  • Use the celestia:setlabelflags{ <labelflagstring> = boolean } method to enable or disable the rendering of labels.
    Note the curly braces.
    <labelflagstring> is a table which contains the labelflags as keys and booleans as values for each key.
    The labelflag keys must be one of:
    • planets, moons, spacecraft, asteroids, comets, stars, galaxies,
      locations, constellations, 1.5.0 i18nconstellations, 1.5.0 openclusters, 1.5.0 nebulae,
      1.6.0 dwarfplanets, 1.6.0 minormoons, 1.6.0 globulars.

Multiple features can be enabled at once by giving multiple arguments to this method, separated with a comma ",".

celestia:setlabelflags{ <labelflagstring1> = false, <labelflagstring2> = true }


Example:
The following examples demonstrate how to clear and set labels.

CEL:

labels { clear "comets|constellations|galaxies|stars" }
labels {   set "asteroids|moons|planets|spacecraft" }

CELX with celestia:hidelabel() and celestia:showlabel() methods:

-- Disable labeling with celestia:hidelabel() method.
celestia:hidelabel("comets", "constellations", galaxies", "stars")
-- Enable labeling with celestia:showlabel() method.
celestia:showlabel("asteroids", "moons", "planets", "spacecraft")

CELX with celestia:setlabelflags() method:

-- Enable and disable the rendering of specific labels. Note the curly braces
celestia:setlabelflags{ comets = false, constellations = false, galaxies = false, stars = false,
                        asteroids = true,  moons = true, planets = true, spacecraft = true }


Back to CEL command index