topical media & game development

talk show tell print

mobile-graphic-enchant-examples-plugins-widget-Alert-Confirm-main.js / js



  enchant();
  window.onload = function() {
      var game = new Game(320, 320);
      game.onload = function() {
          /*
          * new AlertScene()
          * アラートシーンを作成する。
          * ボタンを1つ設定する。
          */
          var alertScene = new AlertScene('その操作は実行できません。', '戻る'); // アラートシーンを作成
          alertScene.onaccept = function() {
              alert('「戻る」が選択されました。');
          };
          game.pushScene(alertScene);
  
          /*
          * new ConfirmScene()
          * コンファームシーンを作成する。
          * ボタンを2つ設定する。
          */
          var confirmScene = new ConfirmScene('本当に実行してもよろしいですか?', 'はい', 'いいえ'); // コンファームシーンを作成
          confirmScene.oncancel = function() {
              alert('「いいえ」が選択されました。');
          };
          confirmScene.onaccept = function() {
              alert('「はい」が選択されました。');
          };
          game.pushScene(confirmScene);
      };
      game.start();
  };
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.