Jump to content
HeckHound

Centering Text

Recommended Posts

How do you go about aligning the text for certain pieces of text?

 

For example, I want the title menu and menu command text to be centered but not the menu status text.

 

So far I've got:

Window_TitleCommand.prototype.textAlign = function(){
	return 'center';
};

Window_TitleCommand.prototype.makeCommandList = function() {
    var align = this.textAlign();
    this.addCommand(TextManager.newGame,   'newGame', align);
    this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled(), align);
    this.addCommand(TextManager.options,   'options', align);
};

but it doesn't work.

 

Thanks in advance :)

Edited by HeckHound

Share this post


Link to post
Share on other sites

What do you mean by centered? 

Like in the center of the screen, or the center of the window it is drawn within?

Share this post


Link to post
Share on other sites

What do you mean by centered? 

Like in the center of the screen, or the center of the window it is drawn within?

 

The center of the window the text is in.

Share this post


Link to post
Share on other sites

You can try in rpg_windows.js.

I think line 1562 might be what you are looking for. 

Maybe modify the x variable to a number.

Edited by DangerZone

Share this post


Link to post
Share on other sites

Ahhhh, found it!

 

If anyone is curious, it's:

Window_Command.prototype.itemTextAlign = function() {
    return 'left'; //Change to 'center'
}; 

Thanks for the help :)

  • Like 2

Share this post


Link to post
Share on other sites

Heh, I was stalking this thread, I wanted to know how to do it.

Thanks ;)

 

Closing topic because it's solved :)

  • Like 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted