Celestia/Celx 指令碼/CELX Lua 方法/CEL 命令標籤
外觀
labels { set|clear <labelflagsstring> }
設定(開啟)或清除(關閉)一個或多個專案的標籤。
引數
- set <labelflagsstring> -- 或者 -- clear <labelflagsstring>
- set 或 clear 字串值可以是下面列出的任何組合。無預設值。
多個值透過空格或豎線 "|" 分隔,在一個引號 "..." 內指定(例如 "moons|stars")- asteroids
- comets
- constellations
- 1.6.0 dwarfplanets
- galaxies
- 1.6.0 globulars
- 1.5.0 i18nconstellations
- 用於在啟用星座標籤時顯示星座的拉丁名稱或翻譯後的名稱。
- locations
- 1.6.0 minormoons
- moons
- 1.5.0 nebulae
- 1.5.0 openclusters
- planets
- spacecraft
- stars
CELX 等效-1
基於 celestia:hidelabel() 和 celestia:showlabel() 方法。
- 使用 celestia:showlabel( <labelflagstring> ) 方法啟用標籤。
<labelflagstring> 描述要啟用的標籤型別。
透過用逗號 "," 分隔,可以一次啟用多種標籤型別。
必須是以下之一- 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.
- planets, moons, spacecraft, asteroids, comets, stars, galaxies,
celestia:showlabel( <labelflagstring> )
- 使用 celestia:hidelabel( <labelflagstring> ) 方法停用標籤。
<labelflagstring> 描述要停用的標籤型別。
透過用逗號 "," 分隔,可以一次停用多種標籤型別。
必須是以下之一- 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.
- planets, moons, spacecraft, asteroids, comets, stars, galaxies,
celestia:hidelabel( <labelflagstring> )
CELX 等效-2
基於 celestia:setlabelflags() 方法。
- 使用 celestia:setlabelflags{ <labelflagstring> = boolean } 方法啟用或停用標籤的渲染。
注意花括號。
<labelflagstring> 是一個表,包含標籤標誌作為鍵,以及每個鍵的布林值。
標籤標誌鍵必須是以下之一- 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.
- planets, moons, spacecraft, asteroids, comets, stars, galaxies,
透過用逗號 "," 分隔,可以一次啟用多種功能。
celestia:setlabelflags{ <labelflagstring1> = false, <labelflagstring2> = true }
例子
以下示例演示瞭如何清除和設定標籤。
CEL
labels { clear "comets|constellations|galaxies|stars" }
labels { set "asteroids|moons|planets|spacecraft" }
CELX 使用 celestia:hidelabel() 和 celestia:showlabel() 方法
-- 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 使用 celestia:setlabelflags() 方法
-- 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 }