RMMV Text Alignment in Menu

StrawberrySmiles

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,768
Reaction score
576
First Language
English
Primarily Uses
RMMV
Hopefully this a simple fix; though I could not figure out myself. I want the gold number to aligned to the right.

Unaligned.png

I have a feeling it's related to this section Yanfly's Core Engine code:
Yanfly Engine Core.png

Or this section of code from SumRndmDde Alt FF7 Menu:
FF7 Gold & Time Window.png

I'm using this plugin to change the word "time" from the FF7 plugin into an icon.

Here's all my plugins if needed:
My Plugins.png
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello. Change the last argument of the drawText function to 'left' instead of 'right'.
Should do it.

edit: seems I read too fast. To align it to more to the right, add a little offset to the wx argument, like:
Code:
let wwx = wx + 20
this.drawText(unit, wwx, wy, ww, 'right')
 

StrawberrySmiles

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,768
Reaction score
576
First Language
English
Primarily Uses
RMMV
That didn't seem to change anything. This is what you meant, right? In Yanfly's code?

Code:
this.drawText(unit, wx + 20 , wy, ww, 'right');
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello, yeah it was an edit for yanfly coreEngine in the drawCurrency function. Just tested it and it work for me, but I don't have the SRD plugin. Does that plugin have its own drawCurrency function, or it call it from windowBase?
 

StrawberrySmiles

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,768
Reaction score
576
First Language
English
Primarily Uses
RMMV
As in the first post, the second block of code, it also has a window.goldandtime.

Maybe I need to have both say wx + 20 and 'right'?
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello, sorry for late response, I was at work.
Then you could try to offset it in SRD plugin by adding + 20 to the x argument
Code:
this.drawCurrencyValue(this.value(), this.currencyUnit(), x + 20, this.lineHeight(), width)
 

StrawberrySmiles

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,768
Reaction score
576
First Language
English
Primarily Uses
RMMV
It moves the number... And the icon...

2020-10-17 00_20_41-Silver Monster.png
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello again, I downloaded the SRD plugin to test it with both plugins. I can still move the text to the right with the changes in YEP_coreEngine. Be sure to offset both drawText functions, that's why I stored the offset in a local variable in my first example, sorry if it wasn't clear enough...
Capture d’écran, le 2020-10-17 à 08.50.01.png
Should work now.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello @Killerslash, if you're using YEP_coreEngine, I think there's a parameter to change the text alignment (but will affect all menus), or you can paste these lines in SRD plugin or any other:
Code:
Window_MenuCommand.prototype.itemTextAlign = function() {
    return 'center';
};
That should do it.
If not, start a separate thread for your problem, and we'll see what can be done ;)
 

Killerslash

Veteran
Veteran
Joined
Mar 31, 2017
Messages
65
Reaction score
12
First Language
Arabic
Primarily Uses
RMMV
I am not using YEP core engine.
 

Killerslash

Veteran
Veteran
Joined
Mar 31, 2017
Messages
65
Reaction score
12
First Language
Arabic
Primarily Uses
RMMV
It's working without YEP CoreEngine.
Thanks for your help.
:smile:
 
  • Like
Reactions: TSR

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,585
Latest member
Reversinator
Top