Skip to content

Instantly share code, notes, and snippets.

@HimeWorks
Created March 2, 2016 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HimeWorks/9ba811c69ea4119869a2 to your computer and use it in GitHub Desktop.
Save HimeWorks/9ba811c69ea4119869a2 to your computer and use it in GitHub Desktop.
Test. Draw 100 numbers in a window on the map.
function Window_Test() {
this.initialize.apply(this, arguments);
}
Window_Test.prototype = Object.create(Window_Base.prototype);
Window_Test.prototype.constructor = Window_Test;
Window_Test.prototype.initialize = function() {
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.width, 200);
this.createContents();
for (var i = 0; i < 100; i++) {
this.contents.drawText(i, 0, i * 24, 100, 24);
}
}
Window_Test.prototype.createContents = function() {
this.contents = new Bitmap(this.contentsWidth(), 10000);
this.resetFontSettings();
};
Scene_Map.prototype.createAllWindows = function() {
this.createMessageWindow();
this.createScrollTextWindow();
this._test = new Window_Test();
this._test.opacity = 0
this.addWindow(this._test);
};
Scene_Map.prototype.update = function() {
this.updateDestination();
this.updateMainMultiply();
if (this.isSceneChangeOk()) {
this.updateScene();
} else if (SceneManager.isNextScene(Scene_Battle)) {
this.updateEncounterEffect();
}
this.updateWaitCount();
Scene_Base.prototype.update.call(this);
if (Input.isPressed("up")) {
this._test.origin.y += 5;
}
else if (Input.isPressed("down")) {
this._test.origin.y -= 5;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment