Hello, I am working on a plugin and running into a strange problem. I am using drawTextEX to try and display a large amount of text inside of a scrollable window. The problem, however, is that only a small portion of the text is being displayed in game.
While debugging the code, I can see that drawTextEX is actually processing through every character in the testState but at some point the characters are no longer being drawn to the window. I will put my text and code snippet for my overridden drawTextEX and the function that calls it that processes the text from the plugin settings. I should note that if I comment out my override and use the drawTextEX from Window_Base that the same issue happens.
In game, the text stops at "pool the resources from across the nation for"
While debugging the code, I can see that drawTextEX is actually processing through every character in the testState but at some point the characters are no longer being drawn to the window. I will put my text and code snippet for my overridden drawTextEX and the function that calls it that processes the text from the plugin settings. I should note that if I comment out my override and use the drawTextEX from Window_Base that the same issue happens.
In game, the text stops at "pool the resources from across the nation for"
Code:
Window_EntryData.prototype.drawCodexInfo = function() {
this.getCodexEntry();
if (!isEmptyObject(this._codexEntry)){
var fmt = JSON.parse(genTxFmt || '');
if (fmt !== ''){
var bEnableWordwrap = fmt.match(/<(?:WordWrap)>/i);
var title = this._codexEntry.title.replace(/\\I\[(\d+)\]/gi, '').trim();
var desc = this._codexEntry.text;
var text = fmt.format(title,desc);
var textState = { index: 0 };
textState.originalText = text;
textState.text = this.convertEscapeCharacters(text);
this._allTextHeight = this.calcTextHeight(textState, true);
this._allTextHeight *= (bEnableWordwrap) ? 10 : 1;
this.createContents();
this.drawTextEx(text, 0, 0);
}
}
}
Window_EntryData.prototype.drawTextEx = function(txt, x, y) {
if (txt) {
var textState = { index: 0, x: x, y: y, left: x};
textState.text = this.convertEscapeCharacters(txt);
textState.height = this.calcTextHeight(textState, false);
this.resetFontSettings();
while (textState.index < textState.text.length) {
this.processCharacter(textState);
}
this._allTextHeight = textState.y - y + this.lineHeight();
return textState.x - x;
} else {
return 0;
}
};