「スクリプティング」の版間の差分
提供: GeoGebra Manual
(make a section) |
(GGBScriptの解説翻訳(前半)) |
||
2行目: | 2行目: | ||
:{{translate|Manual:Scripting}} | :{{translate|Manual:Scripting}} | ||
− | # | + | ==GGBScript== |
+ | GeoGebraコマンドから構成されるようなスクリプトを作ることができます。Inputバーに入力する方法と同じように使えます。スクリプトを実行する(triggering)と,(スクリプトの中のコマンドが)順番に一つ一つ実行されます。 | ||
+ | |||
+ | {{Example|1=<div> | ||
+ | * ''a'' is an integer-valued [[Slider Tool|slider]] ranging from 1 to 3 (therefore Increment equals 1) | ||
+ | * type in: <code><nowiki>list1 = {"red", "green", "blue"}</nowiki></code> | ||
+ | * in properties of ''a'', set "On Update" script to <code>SetColor(a, Element(list1, a))</code> | ||
+ | * by moving the slider you change its color</div>}} | ||
+ | |||
+ | '''解説:''' スライダーが動かされるたびに,アップデート(のキュー)が発生します。ですから,動くたびごとに,スクリプトは呼び出され,リストの中から一つの色が呼び出されて,スライダー a の色が変更されます。 | ||
+ | |||
+ | {{Note|You can use <code>#</code> to start a comment}} | ||
+ | {{Hint|There are commands that can be only used for scripting. You can find them in the page [[Scripting_Commands]].}} | ||
## JavaScript | ## JavaScript |
2017年11月26日 (日) 00:46時点における版
このページは印刷とpdf用の公式マニュアルの一部です。構造上の問題から通常のユーザーはこのページを編集できません。誤りを見つけた場合は私たちに連絡して下さい。ユーザーが編集できるバージョンへ
GeoGebra オブジェクト
Some content was not yet translated. See the English original. Please edit this page if you have the rights for translation. GGBScript
GeoGebraコマンドから構成されるようなスクリプトを作ることができます。Inputバーに入力する方法と同じように使えます。スクリプトを実行する(triggering)と,(スクリプトの中のコマンドが)順番に一つ一つ実行されます。
例:- a is an integer-valued slider ranging from 1 to 3 (therefore Increment equals 1)
- type in:
list1 = {"red", "green", "blue"}
- in properties of a, set "On Update" script to
SetColor(a, Element(list1, a))
- by moving the slider you change its color
解説: スライダーが動かされるたびに,アップデート(のキュー)が発生します。ですから,動くたびごとに,スクリプトは呼び出され,リストの中から一つの色が呼び出されて,スライダー a の色が変更されます。
メモ: You can use#
to start a commentヒント: There are commands that can be only used for scripting. You can find them in the page Scripting_Commands.
- JavaScript
- Global JavaScript
- コメント
- チュートリアル
- 関連