J :
* Font unification.
This commit is contained in:
@@ -29,7 +29,6 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
|
||||
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
mFont->SetRotation(rotation);
|
||||
mFont->SetScale(scale);
|
||||
|
||||
int color = card->getColor();
|
||||
|
||||
@@ -163,10 +162,8 @@ void CardGui::alternateRender(MTGCard * card, JLBFont * mFont, JQuad ** manaIcon
|
||||
if (over > 0){
|
||||
multiply = 1.1;
|
||||
}
|
||||
mFont->SetScale(scale * multiply);
|
||||
mFont->SetColor(ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||
mFont->DrawString(card->getName(),x+v.x,y+v.y);
|
||||
mFont->SetScale(scale);
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
|
||||
|
||||
@@ -348,7 +345,6 @@ void CardGui::Render(){
|
||||
if (card->isTapped()){
|
||||
renderer->FillRect(myX - myH , myY , myH, myW, ARGB(255,Constants::_r[color]/2+50,Constants::_g[color]/2+50,Constants::_b[color]/2+50));
|
||||
renderer->DrawRect(myX - myH , myY , myH, myW, ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.8 * mScale);
|
||||
mFont->DrawString(buffer,myX - (myH)+4,myY + 1);
|
||||
if (mIcon) renderer->RenderQuad(mIcon,myX - myH/2, myY + myW/2,M_PI_2,mScale,mScale);
|
||||
if (tc){
|
||||
@@ -359,7 +355,6 @@ void CardGui::Render(){
|
||||
}else{
|
||||
renderer->FillRect(myX , myY , myW, myH, ARGB(255,Constants::_r[color]/2+50,Constants::_g[color]/2+50,Constants::_b[color]/2+50));
|
||||
renderer->DrawRect(myX , myY , myW, myH, ARGB(255,Constants::_r[color],Constants::_g[color],Constants::_b[color]));
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE * 0.5 * mScale);
|
||||
mFont->DrawString(buffer,myX+4,myY + 1);
|
||||
if (mIcon) renderer->RenderQuad(mIcon,myX + myW/2, myY + myH/2,0,mScale, mScale);
|
||||
if (tc){
|
||||
@@ -368,9 +363,6 @@ void CardGui::Render(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
}
|
||||
|
||||
if (tc && tc->alreadyHasTarget(card)){
|
||||
@@ -382,7 +374,6 @@ void CardGui::Render(){
|
||||
}
|
||||
|
||||
if (card->isACreature()){
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
char buffer[200];
|
||||
sprintf(buffer, "%i/%i",card->power,card->life);
|
||||
renderer->FillRect(x+2,y + mHeight - 12, 25 , 12 ,ARGB(128,0,0,0));
|
||||
|
||||
@@ -336,7 +336,6 @@ void DamageResolverLayer::Render(){
|
||||
if (!mCount) return;
|
||||
JLBFont * mFont = GameApp::CommonRes->GetJLBFont(Constants::MAIN_FONT);
|
||||
mFont->SetBase(0);
|
||||
mFont->SetScale(0.75);
|
||||
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
renderer->FillRect(0 ,0 , SCREEN_WIDTH , SCREEN_HEIGHT , ARGB(200,0,0,0));
|
||||
|
||||
@@ -74,7 +74,6 @@ int DamagerDamaged::removeDamagesFrom(DamagerDamaged * source){
|
||||
void DamagerDamaged::Render(Player * currentPlayer){
|
||||
JLBFont * mFont = GameApp::CommonRes->GetJLBFont(Constants::MAIN_FONT);
|
||||
mFont->SetBase(0);
|
||||
mFont->SetScale(0.75);
|
||||
CardGui::Render();
|
||||
char buf[4096];
|
||||
|
||||
|
||||
@@ -25,20 +25,21 @@ void GameStateShop::Create(){
|
||||
void GameStateShop::Start()
|
||||
{
|
||||
menu = NULL;
|
||||
mFont = GameApp::CommonRes->GetJLBFont("graphics/magic");
|
||||
menuFont = GameApp::CommonRes->GetJLBFont(Constants::MENU_FONT);
|
||||
itemFont = GameApp::CommonRes->GetJLBFont(Constants::MAIN_FONT);
|
||||
|
||||
|
||||
mStage = STAGE_SHOP_SHOP;
|
||||
|
||||
|
||||
bgTexture = JRenderer::GetInstance()->LoadTexture("graphics/shop.jpg", TEX_TYPE_USE_VRAM);
|
||||
mBg = NEW JQuad(bgTexture, 0, 0, 400, 280); // Create background quad for rendering.
|
||||
backTexture = JRenderer::GetInstance()->LoadTexture("sets/back.jpg", TEX_TYPE_USE_VRAM);
|
||||
mBack = NEW JQuad(backTexture, 0, 0, 200, 285); // Create background quad for rendering.
|
||||
|
||||
|
||||
JRenderer::GetInstance()->ResetPrivateVRAM();
|
||||
JRenderer::GetInstance()->EnableVSync(true);
|
||||
|
||||
|
||||
|
||||
int sets[500];
|
||||
int nbsets = 0;
|
||||
for (int i = 0; i < MtgSets::SetsList->nb_items; i++){
|
||||
@@ -53,10 +54,10 @@ void GameStateShop::Start()
|
||||
setId = (rand() % MtgSets::SetsList->nb_items);
|
||||
}
|
||||
JQuad * mBackThumb = GameApp::CommonRes->GetQuad("back_thumb");
|
||||
|
||||
|
||||
shop = NULL;
|
||||
|
||||
shop = NEW ShopItems(10, this, mFont, 10, 10, mParent->collection, setId);
|
||||
|
||||
shop = NEW ShopItems(10, this, itemFont, 10, 10, mParent->collection, setId);
|
||||
sprintf(starterBuffer, "%s Starter (60 cards)",MtgSets::SetsList->values[setId].c_str());
|
||||
sprintf(boosterBuffer, "%s Booster (15 cards)",MtgSets::SetsList->values[setId].c_str());
|
||||
shop->Add(starterBuffer,mBack,mBackThumb, 6000);
|
||||
@@ -92,7 +93,7 @@ void GameStateShop::Update(float dt)
|
||||
if (menu){
|
||||
menu->Update(dt);
|
||||
}else{
|
||||
menu = NEW SimpleMenu(11,this,mFont,SCREEN_WIDTH/2-100,20);
|
||||
menu = NEW SimpleMenu(11,this,menuFont,SCREEN_WIDTH/2-100,20);
|
||||
menu->Add(12,"Save & Back to main menu");
|
||||
menu->Add(13, "Cancel");
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ MenuItem::MenuItem(int id, JLBFont *font, const char* text, int x, int y, JQuad
|
||||
|
||||
if (hasFocus)
|
||||
Entering();
|
||||
// mFont->SetScale(1.2f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,12 +12,8 @@ ShopItem::ShopItem(int id, JLBFont *font, char* text, JQuad * _quad,JQuad * _thu
|
||||
mScale = 1.0f;
|
||||
mTargetScale = 1.0f;
|
||||
|
||||
|
||||
|
||||
if (hasFocus)
|
||||
Entering();
|
||||
mFont->SetScale(1.2f);
|
||||
|
||||
}
|
||||
|
||||
ShopItem::ShopItem(int id, JLBFont *font, int _cardid, int x, int y, bool hasFocus, MTGAllCards * collection, int _price): JGuiObject(id), mFont(font), mX(x), mY(y), price(_price){
|
||||
@@ -26,11 +22,8 @@ ShopItem::ShopItem(int id, JLBFont *font, int _cardid, int x, int y, bool hasFoc
|
||||
mScale = 1.0f;
|
||||
mTargetScale = 1.0f;
|
||||
|
||||
|
||||
|
||||
if (hasFocus)
|
||||
Entering();
|
||||
mFont->SetScale(1.2f);
|
||||
|
||||
card = collection->getCardById(_cardid);
|
||||
quantity = 1;
|
||||
@@ -58,7 +51,7 @@ void ShopItem::Render(){
|
||||
}
|
||||
|
||||
if (thumb){
|
||||
renderer->RenderQuad(thumb,mX,mY,0,mScale * 0.45,mScale * 0.45);
|
||||
renderer->RenderQuad(thumb,mX,mY - (mScale > 1 ? 4 : 0),0,mScale * 0.45,mScale * 0.45);
|
||||
}else{
|
||||
//NOTHING
|
||||
}
|
||||
@@ -79,8 +72,7 @@ void ShopItem::Render(){
|
||||
if (!quantity){
|
||||
mFont->SetColor(ARGB(255,128,128,128));
|
||||
}
|
||||
mFont->SetScale(mScale);
|
||||
mFont->DrawString(mText.c_str(),mX + 30,mY);
|
||||
mFont->DrawString(mText.c_str(), mX + 30, mY + 8);
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +154,7 @@ void ShopItems::Update(float dt){
|
||||
char buffer[4096];
|
||||
sprintf(buffer,"%s : %i credits",item->getText(),price);
|
||||
if(!dialog){
|
||||
dialog = NEW SimpleMenu(1,this,mFont,SCREEN_WIDTH-300,SCREEN_HEIGHT/2,buffer);
|
||||
dialog = NEW SimpleMenu(1,this,GameApp::CommonRes->GetJLBFont(Constants::MENU_FONT),SCREEN_WIDTH-300,SCREEN_HEIGHT/2,buffer);
|
||||
dialog->Add(1,"Yes");
|
||||
dialog->Add(2,"No");
|
||||
}
|
||||
@@ -189,11 +181,11 @@ void ShopItems::Render(){
|
||||
}
|
||||
char credits[512];
|
||||
sprintf(credits,"credits: %i", playerdata->credits);
|
||||
mFont->SetScale(1.2);
|
||||
unsigned int len = 4 + mFont->GetStringWidth(credits);
|
||||
mFont->SetColor(ARGB(200,0,0,0));
|
||||
mFont->DrawString(credits,SCREEN_WIDTH-148, SCREEN_HEIGHT - 13);
|
||||
mFont->DrawString(credits, SCREEN_WIDTH - len + 2, SCREEN_HEIGHT - 13);
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
mFont->DrawString(credits,SCREEN_WIDTH-150, SCREEN_HEIGHT - 15);
|
||||
mFont->DrawString(credits, SCREEN_WIDTH - len, SCREEN_HEIGHT - 15);
|
||||
if (display) display->Render();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,16 +12,13 @@ SimpleMenuItem::SimpleMenuItem(SimpleMenu* _parent, int id, JLBFont *font, const
|
||||
|
||||
if (hasFocus)
|
||||
Entering();
|
||||
mFont->SetScale(1.2f);
|
||||
}
|
||||
|
||||
|
||||
void SimpleMenuItem::RenderWithOffset(float yOffset)
|
||||
{
|
||||
mFont->SetScale(mScale);
|
||||
//mFont->SetColor(ARGB(255,255,255,255));
|
||||
mFont->DrawString(mText.c_str(), mX, mY + yOffset, JGETEXT_CENTER);
|
||||
// mFont->SetScale(1.0f);
|
||||
}
|
||||
|
||||
void SimpleMenuItem::Render()
|
||||
|
||||
Reference in New Issue
Block a user