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

setactiveview
setactiveview { view   } 

Make the view with identifier  the actual active view within a Multi view.

Notes:
 * 1) Using this command only makes sense if there is at least one Muliti view left. This command has no effect on a Single view.

CELX equivalent:

Based on the observer:makeactiveview method.


 * Get observer instances of all views and make the view with identifier  the actual active view.

observers = celestia:getobservers observers[]:makeactiveview

Example: Create a Muliview of 2 views, change active view to goto different planets and after 5 seconds delete view 1.

CEL:

splitview { view 1 type "V" position 0.5 } setactiveview { view 1} select { object "Mercury" } goto  { time 2.0 distance 15 } setactiveview { view 2} select { object "Venus" } goto  { time 2.0 distance 15 } wait { duration 5.0 } deleteview { view 1 }

CELX:

obs = celestia:getobserver obs:splitview("V", 0.5) observers = celestia:getobservers observers[1]:makeactiveview mercury = celestia:find("Sol/Mercury") celestia:select(mercury) observers[1]:gotodistance(mercury, 15*mercury:radius) observers[2]:makeactiveview venus = celestia:find("Sol/Venus") celestia:select(venus) observers[2]:gotodistance(venus, 15*venus:radius) wait(5.0) observers[1]:deleteview

Back to CEL command index