Adjusting font position and size of counter amount.

This commit is contained in:
LevelX2 2014-08-27 08:45:03 +02:00
parent bab5df1385
commit a2fe968582
2 changed files with 7 additions and 3 deletions

View file

@ -879,6 +879,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
private static ImageIcon getCounterImageWithAmount(int amount, BufferedImage image, int cardWidth) { private static ImageIcon getCounterImageWithAmount(int amount, BufferedImage image, int cardWidth) {
int factor = cardWidth > WIDTH_LIMIT ? 2 :1; int factor = cardWidth > WIDTH_LIMIT ? 2 :1;
int xOffset = amount > 9 ? 2 : 5;
int fontSize = amount < 10 ? 9 : amount < 100 ? 9 : 8;
BufferedImage newImage; BufferedImage newImage;
if (cardWidth > WIDTH_LIMIT) { if (cardWidth > WIDTH_LIMIT) {
newImage = ImageManagerImpl.deepCopy(image); newImage = ImageManagerImpl.deepCopy(image);
@ -887,8 +889,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
} }
Graphics graphics = newImage.getGraphics(); Graphics graphics = newImage.getGraphics();
graphics.setColor(Color.BLACK); graphics.setColor(Color.BLACK);
graphics.setFont(new Font("Arial Black", Font.BOLD, factor * 9 )); graphics.setFont(new Font("Arial Black", Font.BOLD, factor * fontSize ));
graphics.drawString(Integer.toString(amount), 4 * factor, 11 * factor); graphics.drawString(Integer.toString(amount), xOffset * factor, 11 * factor);
return new ImageIcon(newImage); return new ImageIcon(newImage);
} }

View file

@ -27,12 +27,12 @@
*/ */
package mage.abilities.mana; package mage.abilities.mana;
import mage.constants.Zone;
import mage.Mana; import mage.Mana;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.common.DynamicManaEffect; import mage.abilities.effects.common.DynamicManaEffect;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
/** /**
@ -46,6 +46,8 @@ public class DynamicManaAbility extends ManaAbility {
/** /**
* TapSourceCost added by default * TapSourceCost added by default
* @param mana
* @param amount
*/ */
public DynamicManaAbility(Mana mana, DynamicValue amount) { public DynamicManaAbility(Mana mana, DynamicValue amount) {
this(mana, amount, new TapSourceCost()); this(mana, amount, new TapSourceCost());