Fixed issue 674 for deck selection in menu by mouse/touch

This commit is contained in:
Xawotihs
2011-06-03 20:01:50 +00:00
parent a4964f944c
commit 40208c4835
2 changed files with 6 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ private:
int fontId;
string mText;
float mTitleResetWidth;
static float mYOffset;
public:
string imageFilename;
@@ -53,7 +54,7 @@ public:
virtual ostream& toString(ostream& out) const;
virtual bool getTopLeft(float& top, float& left)
{
top = mY;
top = mY + mYOffset;
left = mX;
return true;
}

View File

@@ -9,6 +9,8 @@
const int kHorizontalScrollSpeed = 30; // higher numbers mean faster scrolling
float DeckMenuItem::mYOffset = 0;
DeckMenuItem::DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus, bool autoTranslate, DeckMetaData *deckMetaData)
: JGuiObject(id), parent(_parent), fontId(fontId), mX(x), mY(y)
{
@@ -80,6 +82,8 @@ void DeckMenuItem::Update(float dt)
void DeckMenuItem::RenderWithOffset(float yOffset)
{
mYOffset = yOffset;
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
if (!( mHasFocus && mScrollEnabled ))