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


解説/初級編

ワークエリアの利用

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
      });
    }
  ]
});

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

new Theater({
  img: [
    "img/sample1.gif",
    "img/sample2.gif",
    "img/sample3.gif"
  ],
  scenario:[
    function(){
      this.act({
        img: "img/sample1.gif",
        msg: "trueを返却・・・"
      });
      return true;
    },
    function(result){
      this.act({
        img: "img/sample2.gif",
        msg: "前のシナリオ関数の返却値:" + result
             + "。falseを返却・・・"
      });
      return false;
    },
    function(result){
      this.act({
        img: "img/sample3.gif",
        msg: "前のシナリオ関数の返却値:" + result
      });
    }
  ]
});

シナリオ操作

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

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


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