From b756c8b9ec577e0be60ce7206e2eb84e86429977 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 7 Aug 2016 22:33:40 +0800 Subject: [PATCH] resize avatar --- projects/mtg/include/GuiStatic.h | 4 ++-- projects/mtg/src/GuiAvatars.cpp | 16 ++++++++-------- projects/mtg/src/GuiPlay.cpp | 8 ++++---- projects/mtg/src/GuiStatic.cpp | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/projects/mtg/include/GuiStatic.h b/projects/mtg/include/GuiStatic.h index 513d7848b..db7c0505e 100644 --- a/projects/mtg/include/GuiStatic.h +++ b/projects/mtg/include/GuiStatic.h @@ -25,8 +25,8 @@ struct GuiAvatar: public GuiStatic BOTTOM_RIGHT } Corner; - static const unsigned Width = 35; - static const unsigned Height = 50; + static const unsigned Width = 32;//35 + static const unsigned Height = 45;//50 protected: int avatarRed; diff --git a/projects/mtg/src/GuiAvatars.cpp b/projects/mtg/src/GuiAvatars.cpp index b12d2a8fd..4d2af134b 100644 --- a/projects/mtg/src/GuiAvatars.cpp +++ b/projects/mtg/src/GuiAvatars.cpp @@ -20,16 +20,16 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) : Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this)); opponent->zoom = 0.9f; //opponentExile - Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, + Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2f - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); //opponentGraveyard - Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5, false, + Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 5, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); //opponentHand - Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false, + Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); //opponentLibrary - Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false, + Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4f - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayerOpponent(), this)); observer->getCardSelector()->Add(self); @@ -145,12 +145,12 @@ void GuiAvatars::Update(float dt) void GuiAvatars::Render() { JRenderer * r = JRenderer::GetInstance(); - float w = 54; - float h = 54; + float w = 52; + float h = 52; if (opponent == active) { - r->FillRect(opponent->actX, opponent->actY, 40 * opponent->actZ, h+20 * opponent->actZ, ARGB(200,0,0,0)); - r->FillRect(opponent->actX, opponent->actY, w * opponent->actZ, h * opponent->actZ, ARGB(200,0,0,0)); + r->FillRect(opponent->actX, opponent->actY, 34 * opponent->actZ, h+22 * opponent->actZ, ARGB(200,0,0,0)); + r->FillRect(opponent->actX, opponent->actY, (w * opponent->actZ)-1, (h * opponent->actZ)+2, ARGB(200,0,0,0)); } else if (self == active) { diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index e723976df..6e0ed09ff 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -91,9 +91,9 @@ void GuiPlay::VertStack::Enstack(CardView* card) card->x = x + baseX; card->y = y + baseY; - y += 10; - if (++count == total - 1 && y == 10) - y += 10; + y += 9; + if (++count == total - 1 && y == 9) + y += 9; //last value += 12... } @@ -133,7 +133,7 @@ void GuiPlay::BattleField::reset(float x, float y) void GuiPlay::BattleField::EnstackAttacker(CardView* card) { //card->x = CARD_WIDTH + 20 + (currentAttacker * (HORZWIDTH) / (attackers+1)); - card->x = x-6 + baseX; + card->x = x-4 + baseX; if (attackers+1 < 8) x += CARD_WIDTH; else if (attackers+1 < 24) diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index baa30379a..d41002585 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -88,11 +88,11 @@ void GuiAvatar::Render() } if (player->getObserver()->currentPlayer == player) - r->DrawRect(x0 - 1, y0 - 1, 36 * actZ, 51 * actZ, ARGB((int)actA, 0, 255, 0)); + r->DrawRect(x0 - 1, y0 - 1, (Width+1) * actZ, (Height+1) * actZ, ARGB((int)actA, 0, 255, 0)); else if (player->getObserver()->currentActionPlayer == player) - r->DrawRect(x0, y0, 34 * actZ, 49 * actZ, ARGB((int)actA, 0, 0, 255)); + r->DrawRect(x0, y0, (Width-1) * actZ, (Height-1) * actZ, ARGB((int)actA, 0, 0, 255)); if (player->getObserver()->isInterrupting == player) - r->DrawRect(x0, y0, 34 * actZ, 49 * actZ, ARGB((int)actA, 255, 0, 0)); + r->DrawRect(x0, y0, (Width-1) * actZ, (Height-1) * actZ, ARGB((int)actA, 255, 0, 0)); //Life char buffer[10];