add tooltip on textscroller
This commit is contained in:
@@ -781,9 +781,8 @@ void GameStateMenu::Render()
|
|||||||
sprintf(text, "%s", _("LOADING...").c_str());
|
sprintf(text, "%s", _("LOADING...").c_str());
|
||||||
}
|
}
|
||||||
//rectangle
|
//rectangle
|
||||||
renderer->FillRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(225,5,5,5));
|
renderer->FillRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(225,5,5,5));;
|
||||||
//renderer->FillRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(25,205,0,0));
|
renderer->DrawRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(200, 204, 153, 0));
|
||||||
renderer->DrawRect(0, SCREEN_HEIGHT - 50, SCREEN_WIDTH + 1.5f, mFont->GetHeight(),ARGB(200, 204, 153, 0));
|
|
||||||
//end
|
//end
|
||||||
mFont->SetColor(ARGB(170,0,0,0));
|
mFont->SetColor(ARGB(170,0,0,0));
|
||||||
mFont->DrawString(text, SCREEN_WIDTH / 2 + 2, SCREEN_HEIGHT - 50 + 2, JGETEXT_CENTER);
|
mFont->DrawString(text, SCREEN_WIDTH / 2 + 2, SCREEN_HEIGHT - 50 + 2, JGETEXT_CENTER);
|
||||||
|
|||||||
@@ -67,10 +67,18 @@ void TextScroller::Update(float dt)
|
|||||||
void TextScroller::Render()
|
void TextScroller::Render()
|
||||||
{
|
{
|
||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||||
//JRenderer::GetInstance()->DrawLine(mX,mY,mX+mWidth,mY, ARGB(100, 255, 255, 255));
|
//tooltip
|
||||||
JRenderer::GetInstance()->FillRoundRect(mX,mY,mWidth,mFont->GetHeight(), 1, ARGB(225,5,5,5));
|
JQuadPtr tooltips;
|
||||||
//JRenderer::GetInstance()->FillRect(mX,mY,mWidth,mFont->GetHeight(), ARGB(25,205,0,0));
|
tooltips = WResourceManager::Instance()->RetrieveTempQuad("tooltips.png");//new graphics tooltips
|
||||||
//JRenderer::GetInstance()->DrawLine(mX,mY+11,mX+mWidth,mY+11, ARGB(100, 255, 255, 255));
|
if (tooltips.get())
|
||||||
|
{
|
||||||
|
float xscale = (mWidth+(mWidth/18)) / tooltips->mWidth;
|
||||||
|
float yscale = mFont->GetHeight() / tooltips->mHeight;
|
||||||
|
JRenderer::GetInstance()->RenderQuad(tooltips.get(), mX-4.5f, mY+0.5f,0,xscale,yscale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
JRenderer::GetInstance()->FillRoundRect(mX,mY,mWidth,mFont->GetHeight(), 1, ARGB(225,5,5,5));
|
||||||
|
//end tooltip
|
||||||
mFont->DrawString(mText.c_str(), mX, mY, JGETEXT_LEFT, start, mWidth);
|
mFont->DrawString(mText.c_str(), mX, mY, JGETEXT_LEFT, start, mWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user