Hello everyone. My goal is to display battle log text, one line at a time, in a visible window. Here's what I have so far.
The problem is, "Window_BattleLog.prototype.maxLines" only determines the window size, so if there is more than one line of battle text, it trails off the window. For example:
Slime B attacks!
Harold takes 15 damage!
Using my code above in a plug-in causes the "Harold takes 15 damage" to not be visible since it is no longer in the window. I want only one line to appear at a time, so ideally, "Slime B attacks" should be overwritten with "Harold takes 15 damage". In the screenshot below, you can see that the second line is cut off, rather than replacing "Slime B attacks".
I think the lines drawn have something to do with "_baseLineStack", but I cannot figure it out. Any assistance is very much appreciated.
JavaScript:
Window_BattleLog.prototype.initialize = function() {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
this.opacity = 0;
this._lines = [];
this._methods = [];
this._waitCount = 0;
this._waitMode = '';
this._baseLineStack = [];
this._spriteset = null;
this.createBackBitmap();
this.createBackSprite();
this.refresh();
};
Window_BattleLog.prototype.maxLines = function() {
return 1;
};
Window_BattleLog.prototype.refresh = function() {
this.drawBackground();
this.contents.clear();
this.hide();
for (var i = 0; i < this._lines.length; i++) {
this.drawLineText(i);
this.opacity = 255;
this.show();
}
};
The problem is, "Window_BattleLog.prototype.maxLines" only determines the window size, so if there is more than one line of battle text, it trails off the window. For example:
Slime B attacks!
Harold takes 15 damage!
Using my code above in a plug-in causes the "Harold takes 15 damage" to not be visible since it is no longer in the window. I want only one line to appear at a time, so ideally, "Slime B attacks" should be overwritten with "Harold takes 15 damage". In the screenshot below, you can see that the second line is cut off, rather than replacing "Slime B attacks".
I think the lines drawn have something to do with "_baseLineStack", but I cannot figure it out. Any assistance is very much appreciated.