※このページは書きかけです。


解説/初級編

ワークエリアの利用

workプロパティオブジェクトの使用

new Theater({
  img: [
    "img/sample1.gif",
    "img/sample2.gif",
    "img/sample3.gif"
  ],
  scenario:[
    function(){
      this.work.count = 0;
      this.act({
        img: "img/sample1.gif",
        msg: "カウント:" + this.work.count
      });
    },
    function(){
      this.work.count++;
      this.act({
        img: "img/sample2.gif",
        msg: "カウント:" + this.work.count
      });
    },
    function(){
      this.work.count++;
      this.act({
        img: "img/sample3.gif",
        msg: "カウント:" + this.work.count
      });
    }
  ]
});

workオブジェクトそのものを削除したり、work以外の他のメンバを破壊しないように注意してください。

setValメソッドとgetValメソッドの使用

new Theater({
  img: [
    "img/sample1.gif",
    "img/sample2.gif",
    "img/sample3.gif"
  ],
  scenario:[
    function(){
      this.setVal("count", 0);
      this.act({
        img: "img/sample1.gif",
        msg: "カウント:" + this.getVal("count")
      });
    },
    function(){
      this.setVal("count", this.getVal("count") + 1);
      this.act({
        img: "img/sample2.gif",
        msg: "カウント:" + this.getVal("count")
      });
    },
    function(){
      this.setVal("count", this.getVal("count") + 1);
      this.act({
        img: "img/sample3.gif",
        msg: "カウント:" + this.getVal("count")
      });
    }
  ]
});

シナリオ関数の返却値と引数

シナリオ操作

メニュー表示とユーザ入力取得


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS