Celestia/Celx Scripting/CELX Lua Methods/CEL command center
center
editcenter { time <duration> }
Centers the currently selected object in the display in <duration> seconds. you must first use the select command to select an object to be centered.
Arguments:
- time <duration>
- Number of seconds to take centering the object. Default is 1.0 second.
CELX equivalent:
Based on the observer:center() method.
- Find and select target object with name <string> to be centered and store in "objectname"
objectname = celestia:find( <string> )
- Get observer instance of the active view and center objectname.
If no <duration> is given, the default time = 5.0 secondsĀ !!!
obs = celestia:getobserver() obs:center(objectname, <duration> )
- Wait <duration> seconds.
wait( <duration> )
Summarized:
objectname = celestia:find( <string> ) obs = celestia:getobserver() obs:center(objectname, <duration> ) wait( <duration> )
Example:
The following example selects the Earth and takes 5.5 seconds to center it on the screen. If you do not see the Earth, press the [G] key on your keyboard and you should see the Earth zoom into view from the center of the display.
CEL:
select { object "Sol/Earth" } center { time 5.5 }
CELX:
earth = celestia:find("Sol/Earth") celestia:select(earth) obs = celestia:getobserver() obs:center(earth, 5.5) wait(5.5)