別ウィンドウに対して表示を行うの場合、リスト形式などしないのなら
デフォルトのWindow_Helpをまるまる持ってきて少し改変すると楽です。
今回のは$gameTemp.xxxxに値を突っ込んで、そのが値が変化したら再描画を行う簡易的な物です。
画像の読み込みが終わる前に処理が走るとbitmapのwidthが0になり表示されなくなることがあります
下記のは擬似的にリフレッシュがかかった場合、もう一度再描画させてるのでTitleとMenuで画像読み込んでやるのが
一番良いです
コード: 全て選択
(function(){
    //============================================================
    //■Window_Options
    //============================================================
    var Mtest_Window_Options_drawItem = Window_Options.prototype.drawItem;
    Window_Options.prototype.drawItem = function(index) {
        Mtest_Window_Options_drawItem.call(this,index);
        //シンボルで判定
        if (this._list[index].symbol === 'Number1') {
            //オプション画面内では$gameVariablesの値が変動しないので
            //簡単に済ませる為に$gameTempに変数を作成して、変数の値を代入
            $gameTemp._testVal = this.statusText(index);
        }
    };
    //============================================================
    //■Window_TestOptions  新規追加Window
    //============================================================
    function Window_TestOptions() {
        this.initialize.apply(this, arguments);
    }
    Window_TestOptions.prototype = Object.create(Window_Base.prototype);
    Window_TestOptions.prototype.constructor = Window_TestOptions;
    Window_TestOptions.prototype.initialize = function(numLines) {
        var width = 400;
        var height = 100;
        Window_Base.prototype.initialize.call(this, 0, 0, width, height);
        //this.opacity = 0;
        this._text = '';
        this._count = 0; //簡易bitmap.width === 0 回避用
    };
    //リフレッシュ
    Window_TestOptions.prototype.refresh = function() {
        this.contents.clear();
        this._text = $gameTemp._testVal;
        this.drawImage();
        this.drawIcon($gameTemp._testVal, 0, 0); //drawIcon(iconIndex ,x ,y );
        this.drawText(this._text, 0, 38, 100, 'left');
    };
    //画像読み込み
    Window_TestOptions.prototype.drawImage = function() {
        var bitmap = ImageManager.loadSystem('Loading');
        this.contents.blt(bitmap, 0, 0, 400, 100, 0, 0);
        this._count++;
    };
    //フレーム更新
    Window_TestOptions.prototype.update = function() {
        Window_Base.prototype.update.call(this);
        if (this._text != $gameTemp._testVal) this.refresh();
        if (this._count === 1) {
            this.refresh();
            this._count--;
        }
    };
    //============================================================
    //■Scene_Options
    //============================================================
    var Mtest_Scene_Options_create = Scene_Options.prototype.create;
    Scene_Options.prototype.create = function() {
        Mtest_Scene_Options_create.call(this);
        this.createTestWindow();
    };
    //新規追加
    Scene_Options.prototype.createTestWindow = function() {
        this._optionsTestWindow = new Window_TestOptions();
        this.addWindow(this._optionsTestWindow);
    };
})();
			
		
				
			 
- ScreenShot00202.png (414.61 KiB) 閲覧された回数 6796 回