Bitmap.DrawText align parameter bugged?

From helpfile:

drawText ( text , x , y , maxWidth , lineHeight , align )
So okay that looks simple.

Does not work:

this.drawText(text, x, y, width, height, 'center');Does not work:

this.drawText(text, x, y, width, height, 1);Does work:

this.drawText(text, x, y, width, 'center');Can someone explain to me why it only works when leaving out the height-parameter? Or did I mess something else up.

Also the helpfile is stupid regarding this part:

  • align StringThe alignment of the text
Obviously I was expecting the possible values to put in there... Because in Ace we had to use numbers. That explanation was so useless.
Well depends. Are you actually using that drawText on a Bitmap or on a window? Because the Windows changes the drawText parameters.

Well if you look at the Window_Base you'll find

Window_Base.prototype.drawText = function(text, x, y, maxWidth, align)Seems like we don't use the height parameter in mv no more, and is auto set to .lineHeight()
Window_Base.prototype.drawText = function(text, x, y, maxWidth, align) {

    this.contents.drawText(text, x, y, maxWidth, this.lineHeight(), align);

};

 

 

Window_Base does not accept height as a parameter as it defaults to line height.

You would have to use this.contents.drawText to specify a height
Thanks guys. I totally overlooked that,

Original thread: https://forums.rpgmakerweb.com/threads/bitmap-drawtext-align-parameter-bugged.50973/