Bitmap.DrawText align parameter bugged?

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
424
Reaction score
171
First Language
Dutch
Primarily Uses
RMMV
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.
 

Quxios

Veteran
Veteran
Joined
Jan 8, 2014
Messages
1,055
Reaction score
785
First Language
English
Primarily Uses
RMMV
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()
 

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
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
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
424
Reaction score
171
First Language
Dutch
Primarily Uses
RMMV
Thanks guys. I totally overlooked that,
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top