スクリプトのサンプル

ここで次のような場面展開をする番組があるとします。

この画面展開をステラトークのスクリプトで記述すると、次のサンプルのようになります。

個々のコマンドの意味については、『コマンド・オブジェクト・プロパティ一覧』をご覧ください。ただしサンプルでは一覧に記載されていないコマンドも使用されています。


# StellaNavigator Demo Script
# ←この記号で始まっている行はコメント
# 『初期化』
Initialize Sky
# 表示条件を設定します。
# 場所を東京に設定
Location = Location(139.7,35.3)
# 2002 年8 月1 日に設定
Time = JST(2002,08,01,15,00,00)
# 本日の日の入り2時間前に設定
Time = JD( Solar.Sun.Jd.Set - 2 / 24 )
# 地平線をまっすぐにする
View.StraightTheHorizon = True
# 西の方角に視野を向ける
View.Center = HRZ( 90 , * )
# 視野角を120 度にする
View.Angle = 120deg
# ここまでの設定で星図を描画します。
FadeIn Sky,1sec
# 地平線をまっすぐにする解除
View.StraightTheHorizon = False
# 星図中心の高度を変数に代入する
$NowCenterAlt = View.Center.Position.Altitude
# 1秒の間を空ける
sleep 1sec
# 『モーション』の例
# 太陽高度が-9 度になるまで、時間を進める
Motion.Time = True
Motion.Time.Realtime = False
Motion.Time.Speed.Step = False
Motion.Time.Goal = JD ( Solar.Sun.Jd.Set.BelowTheHorizon.9 )
Motion.Time.Speed = 400
Play Sky
WaitFor (Motion.Stop)
Motion.Time = False
プロパティを設定する行では、
『=』の前後に必ず半角のスペー
スを挿入してください。
英文字の大文字と小文字は同一
と見なされます。
# 『条件分岐』の例
# 金星が星図の中にいれば紹介をする
if ( Solar.Planet.Venus.OnScreen )
sleep 1sec
# 金星の名前を表示
Solar.Planet.Venus.Name.Visible = True
FadeIn Sky,1sec
sleep 1sec
# 金星を拡大する
$NowAzm = View.Center.Position.Azimuth
$NowAlt = View.Center.Position.Altitude
$NowAng = View.Angle
Motion.Zoom = True
Motion.Zoom.Speed = 2
Motion.Zoom.Goal = 0.2deg
Motion.Zoom.ViewCenter = True
Motion.Zoom.ViewCenter.Goal = Solar.Planet.Venus
Play Sky
WaitFor (Motion.Stop)
Motion.Zoom = False
Motion.Zoom.ViewCenter = False
# 金星の説明をする
Play Sound(#1,venus.wav)
WaitFor (Sound.#1.Stop)
# 拡大する前の視野に戻す
Motion.Zoom = True
Motion.Zoom.Speed = 2
Motion.Zoom.Goal = $NowAng
Motion.Zoom.ViewCenter = True
Motion.Zoom.ViewCenter.Goal = HRZ( $NowAzm , $NowAlt )
Play Sky
WaitFor (Motion.Stop)
Motion.Zoom = False
Motion.Zoom.ViewCenter = False
# 金星の名前を消す
Solar.Planet.Venus.Name.Visible = False
FadeIn Sky,1sec
end if
sleep 1sec
# 『モーション』の例
# 太陽高度が-18 度になるまで、時間を進める
Motion.Time = True
Motion.Time.Realtime = False
Motion.Time.Speed.Step = False
Motion.Time.Goal = JD ( Solar.Sun.Jd.Set.BelowTheHorizon.18 )
Motion.Time.Speed = 400
Play Sky
WaitFor (Motion.Stop)
Motion.Time = False
sleep 1sec
# 『視野のモーション』の例
# こと座に視野を移動する
Motion.ViewCenter = True
Motion.ViewCenter.Goal = Constellation.Lyr
Motion.ViewCenter.Speed = 270dpm
Play Sky
WaitFor (Motion.Stop)
Motion.ViewCenter = False
sleep 1sec
# こと座の星座絵を表示する
Constellation.Lyr.Picture.Visible = True
FadeIn Sky,2sec
sleep 1sec
# こと座の星座線を表示する
Constellation.Lyr.Line.Visible = True
FadeIn Sky,1sec
sleep 1sec
# こと座の星座名を表示する
Constellation.Lyr.Name.Visible = True
FadeIn Sky,1sec
sleep 1sec
# 星座名と星座絵を消す
Constellation.Lyr.Picture.Visible = False
Constellation.Lyr.Name.Visible = False
FadeIn Sky,1sec
# ドーナッツ星雲の文字とマークを表示する
DeepSkyObject.M57.Mark.Visible = True
Show sky
String.#1.Align = Align(BottomLeft)
String.#1.Margin.x = 5
String.#1.Margin.y = 0
FadeIn String(#1,"ドーナッツ星雲",DeepSkyObject.M57),1sec
sleep 1sec
# M57 マークを消す
DeepSkyObject.M57.Mark.Visible = False
Show sky
# M57 をズームする
$NowAzm = View.Center.Position.Azimuth
$NowAlt = View.Center.Position.Altitude
$NowAng = View.Angle
Motion.Zoom = True
Motion.Zoom.Speed = 2
Motion.Zoom.Goal = 0.2deg
Motion.Zoom.ViewCenter = True
Motion.Zoom.ViewCenter.Goal = DeepSkyObject.M57
Play Sky
WaitFor (Motion.Stop)
Motion.Zoom = False
Motion.Zoom.ViewCenter = False
# 『サウンド再生』『画像表示』の例
# M57 の説明をする
Play Sound(#1,m57.wav)
FadeIn Image(#1,m57.jpg),1sec
WaitFor (Sound.#1.Stop)
FadeOut Image(#1),1sec
# 拡大する前の視野に戻す
Motion.Zoom = True
Motion.Zoom.Speed = 2
Motion.Zoom.Goal = $NowAng
Motion.Zoom.ViewCenter = True
Motion.Zoom.ViewCenter.Goal = HRZ( $NowAzm , $NowAlt )
Play Sky
WaitFor (Motion.Stop)
Motion.Zoom = False
Motion.Zoom.ViewCenter = False
# ドーナッツ星雲の文字を消す
FadeOut String(#1),1sec
sleep 1sec
# こと座星座線を消し、全星座絵を表示する
Constellation.Lyr.Line.Visible = False
Constellation.Picture.Visible = True
FadeIn Sky,2sec
sleep 1sec
# 全星座線を表示する
Constellation.Line.Visible = True
FadeIn Sky,1sec
sleep 1sec
# 全星座名を表示する
Constellation.Name.Visible = True
FadeIn Sky,1sec
sleep 1sec
# 全星座絵、全星座線、全星座名を消す
Constellation.Picture.Visible = False
Constellation.Line.Visible = False
Constellation.Name.Visible = False
FadeIn Sky,1sec
# 東の空へ視野を移動する
Motion.ViewCenter = True
Motion.ViewCenter.Goal = HRZ( 270 , $NowCenterAlt )
Motion.ViewCenter.Speed = 270dpm
Play Sky
WaitFor (Motion.Stop)
Motion.ViewCenter = False
# 日の出一時間後まで、時間を進めて終わり
Motion.Time = True
Motion.Time.Realtime = False
Motion.Time.Speed.Step = False
Motion.Time.Goal = JD ( Solar.Sun.Jd.Rise + 25 / 24 )
Motion.Time.Speed = 400
Play Sky
WaitFor (Motion.Stop)
Motion.Time = False