diff --git a/projects/mtg/include/SimpleMenu.h b/projects/mtg/include/SimpleMenu.h index 7dab22464..000b1a0f9 100644 --- a/projects/mtg/include/SimpleMenu.h +++ b/projects/mtg/include/SimpleMenu.h @@ -43,6 +43,7 @@ public: void Update(float dt); void Add(int id, const char * Text, string desc = "", bool forceFocus = false); int getmCurr(){return mCurr;} + float getWidth(){return mWidth; } void Close(); void RecenterMenu(); diff --git a/projects/mtg/src/SimpleMenuItem.cpp b/projects/mtg/src/SimpleMenuItem.cpp index 514a433d3..c2883c2cd 100644 --- a/projects/mtg/src/SimpleMenuItem.cpp +++ b/projects/mtg/src/SimpleMenuItem.cpp @@ -94,7 +94,7 @@ bool SimpleMenuItem::ButtonPressed() void SimpleMenuItem::Relocate(float x, float y) { - mXOffset = x; + mXOffset = x - (parent->getWidth()/2); // determines the leftmost point of the text; mX = x; mY = y; }