EXP Menu Bar Position

I'm trying to figure out a way to position the EXP bar on my main menu in such a way that it will scale with a resolution change instead of me hardcoding position or offsets.

Below is my main menu at the default resolution, currently the EXP Bar is below the TP bar and both bar widths have been halved. What I'd like to do is move the EXP bar so that it is next to the TP Bar.

Spoiler
XP Bar Topic.png
Below is my code so far (any pointers on how to improve will be appreciated, I'm still very much a beginner)

Spoiler
//=============================================================================

// Plugin: Beenbaba Exp Bar

// Author: Beenbaba

// Date: 03/11/2015  

//=============================================================================

  

 

/*:

 * @plugindesc Shows EXP Bar on Menu

 * @author Beenbaba                            

 *                                  

 * @param Colour1

 * @desc Colour 1 of EXP Bar

 * @default 30

 *

 * @param Colour2

 * @desc Colour 2 of EXP Bar

 * @default 31

 *

 * @param EXP Name

 * @desc Name of EXP Bar

 * @default XP

 *

 */

 

                   

            

 //================================================================           

 // DECLARE FUNCTION

 //================================================================

 

  

 

  (function() {

  var parameters = PluginManager.parameters('BabaExpBar');

  var Color1XP = Number(parameters['Colour1']);

  var Color2XP = Number(parameters['Colour2']);

  var XPName = String(parameters['EXP Name']);

   

 

//=================================================================

// CREATE LEVEL UP BAR

//=================================================================

     

  Window_Base.prototype.drawActorEXPWithGauge = function (actor, x, y, width) {

    width = width || 96;

    var rate = (actor.currentExp() - actor.currentLevelExp()) / (actor.expForLevel(actor._level + 1) - actor.expForLevel(actor._level));

    this.drawGauge(x, y, width / 2, rate, this.textColor(Color1XP), this.textColor(Color2XP));

    this.changeTextColor(this.systemColor());

    this.drawText(XPName, x, y, 44);

    this.drawCurrentAndMax(actor.currentExp() - actor.currentLevelExp(), actor.expForLevel(actor._level + 1) - actor.expForLevel(actor._level), x, y, width / 2,

                           this.mpColor(actor), this.normalColor());

  };

 

 

//=================================================================

// CHANGE TP BAR TO HALF SIZE

//=================================================================

 

  Window_Base.prototype.drawActorTp = function(actor, x, y, width) {

    width = width || 96;

    var color1 = this.tpGaugeColor1();

    var color2 = this.tpGaugeColor2();

    this.drawGauge(x, y, width / 2, actor.tpRate(), color1, color2);

    this.changeTextColor(this.systemColor());

    this.drawText(TextManager.tpA, x, y, 44);

    this.changeTextColor(this.tpColor(actor));

    this.drawText(actor.tp, x + (width / 2) - 64, y, 64,

      'right');

  };

 

 

 

//=================================================================

// ADD TO SIMPLE STATUS

//=================================================================

 

 

_Window_Base_drawActorSimpleStatus = Window_Base.prototype.drawActorSimpleStatus;

  Window_Base.prototype.drawActorSimpleStatus = function (actor, x, y, width) {

    _Window_Base_drawActorSimpleStatus.call(this, actor, x, y, width);

    var lineHeight = this.lineHeight();

    var xpad = Window_Base._faceWidth + (2 * Yanfly.Param.TextPadding);

    var x2 = x + xpad;

    var width2 = Math.max(200, width - xpad - this.textPadding());

    this.drawActorEXPWithGauge(actor, x2, y + lineHeight * 4, width2);

  };

 

 

   

})();  // dont touch this.

 

//=============================================================================

// END PLUGIN

//=============================================================================
 

Thanks in advance
Increase the x value of the XP bar probably the amount of the width. Decrease Y value probably by lineHeight.
I changed x2 value to x2 + width2 / 2 and changed to Y lineHeight to * 3 instead of 4 and it worked! Thanks for your help Jeremy, much appreciated.
Am always looking to help....it helps me learn too.
I just realised that part of my plugin is overwriting the TP gauge draw so that it is half width, which effects the TP gauge in battle as well. How would I go about changing it so that only in the menu it is half width?
You have to change the TP Gauge in Window status. This will then change in in the window status but leave it unchanged in battle.
This is because you are overwriting the TP Gauge function. So any time the game calls that function it will do what you modified it to do.

So instead of modified the ActorTP function to make the width /2 you need to just change the width/2 where you need it.
So in your status it needs to be

this.drawActorTp(actor, x, y, width/2) 
I can't see where it draws the TP in the Window MenuStatus and don't think it does draw it in the menu, I know yanfly does it by adding the draw TP to the actor simple status in his core engine but I can't see where the engine as default draws the TP gauge on the menu.
Yes it normally doesn't.

So in the YEP core change it to

if (eval(Yanfly.Param.MenuTpGauge)) {

this.drawActorTp(actor, x2, y + lineHeight * 3, width2/2);

}

 

That will change the width of the bar when it draws it 

Original thread: https://forums.rpgmakerweb.com/threads/exp-menu-bar-position.49510/