Improved Vertical Scrolling

This commit is contained in:
techdragon.nguyen@gmail.com
2010-11-28 23:54:36 +00:00
parent 3205ebdc8b
commit 8fd35ac513
7 changed files with 70 additions and 47 deletions

View File

@@ -70,9 +70,9 @@ void DeckMenuItem::RenderWithOffset(float yOffset)
JTexture * tex = resources.RetrieveTexture("new.png");
if (tex)
{
JQuad * quad = resources.RetrieveQuad("new.png", 2, 2, tex->mWidth - 4, tex->mHeight - 4); //avoids weird rectangle aroudn the texture because of bilinear filtering
quad->SetHotSpot(quad->mWidth/2, quad->mHeight/2);
float x = mX + min(ITEM_PX_WIDTH - quad->mWidth, mFont->GetStringWidth(menuItemString.c_str()))/2 + quad->mWidth/2;
JQuad * quad = resources.RetrieveQuad("new.png", 2, 2, tex->mWidth - 4, tex->mHeight - 4); //avoids weird rectangle aroudn the texture because of bilinear filtering
quad->SetHotSpot(quad->mWidth/2, quad->mHeight/2);
float x = mX + min(ITEM_PX_WIDTH - quad->mWidth, mFont->GetStringWidth(menuItemString.c_str()))/2 + quad->mWidth/2;
if (quad) JRenderer::GetInstance()->RenderQuad(quad, x , mY + yOffset + quad->mHeight/2, 0.5);
}
}