forked from External/mage
Added card transform in UI. For now for all cards.
This commit is contained in:
parent
d3dfb67ffc
commit
903dc0c5ef
9 changed files with 777 additions and 658 deletions
|
|
@ -4,4 +4,6 @@ import java.awt.*;
|
|||
|
||||
public interface ImageManager {
|
||||
public Image getSicknessImage();
|
||||
public Image getDayImage();
|
||||
public Image getNightImage();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,24 @@ public class ImageManagerImpl implements ImageManager {
|
|||
return imageSickness;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedImage getDayImage() {
|
||||
if (imageDay == null) {
|
||||
Image image = getImageFromResourceTransparent("/card/day.png", Color.WHITE, new Rectangle(20, 20));
|
||||
imageDay = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
|
||||
}
|
||||
return imageDay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedImage getNightImage() {
|
||||
if (imageNight == null) {
|
||||
Image image = getImageFromResourceTransparent("/card/night.png", Color.WHITE, new Rectangle(20, 20));
|
||||
imageNight = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
|
||||
}
|
||||
return imageNight;
|
||||
}
|
||||
|
||||
protected static Image getImageFromResourceTransparent(String path, Color mask, Rectangle rec) {
|
||||
BufferedImage image = null;
|
||||
Image imageCardTransparent = null;
|
||||
|
|
@ -54,4 +72,6 @@ public class ImageManagerImpl implements ImageManager {
|
|||
}
|
||||
|
||||
private static BufferedImage imageSickness = null;
|
||||
private static BufferedImage imageDay = null;
|
||||
private static BufferedImage imageNight = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue