このWikiは古くなりました:
新しいWikiへ移動
PlainChar.waitInput
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
//METHOD
[[PlainChar]]に戻る
[[PlainChar.waitInput]] - 文字入力用のウィンドウを開き、...
**書式 [#s602cb90]
waitInput(title,prompt,default)
:title| 文字入力用のウィンドウのタイトルバーに表示する文...
:prompt| プロンプト部分(入力部分のすぐ上)に表示する文字...
:default| 入力部分にあらかじめ入っている文字列
**戻り値 [#uf39c219]
入力された文字列。
ユーザが「Ok」「キャンセル」のどちらを押したかは[[$InputB...
-ダイアログが開いている最中でも,他のオブジェクトは動作を...
-オブジェクトの処理を中断したくないときは[[$InputBox.open...
-[[onMouseDown]],[[onMouseDrag]]メソッドの中ではこのメソ...
**例1 [#n101404a]
extends SpriteChar;
while (1) {
// rに入力結果をいれる
r=waitInput("どっちへいきますか","\"L\":← \"R\":→ ");
if ($InputBox.getStatus()==2) die(); // キャンセル押し...
if (r=="Left") { // "Left" を入力したら 、左に移動
for (i=0 ; i<16 ; i++) {
x--;
update();
}
}
if (r=="Right") { // "Right" を入力したら 、左に移動
for (i=0 ; i<16 ; i++) {
x++;
update();
}
}
update();
}
終了行:
//METHOD
[[PlainChar]]に戻る
[[PlainChar.waitInput]] - 文字入力用のウィンドウを開き、...
**書式 [#s602cb90]
waitInput(title,prompt,default)
:title| 文字入力用のウィンドウのタイトルバーに表示する文...
:prompt| プロンプト部分(入力部分のすぐ上)に表示する文字...
:default| 入力部分にあらかじめ入っている文字列
**戻り値 [#uf39c219]
入力された文字列。
ユーザが「Ok」「キャンセル」のどちらを押したかは[[$InputB...
-ダイアログが開いている最中でも,他のオブジェクトは動作を...
-オブジェクトの処理を中断したくないときは[[$InputBox.open...
-[[onMouseDown]],[[onMouseDrag]]メソッドの中ではこのメソ...
**例1 [#n101404a]
extends SpriteChar;
while (1) {
// rに入力結果をいれる
r=waitInput("どっちへいきますか","\"L\":← \"R\":→ ");
if ($InputBox.getStatus()==2) die(); // キャンセル押し...
if (r=="Left") { // "Left" を入力したら 、左に移動
for (i=0 ; i<16 ; i++) {
x--;
update();
}
}
if (r=="Right") { // "Right" を入力したら 、左に移動
for (i=0 ; i<16 ; i++) {
x++;
update();
}
}
update();
}
ページ名: