mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Make card images show up
This commit is contained in:
@@ -62,9 +62,9 @@ public class ImageCache {
|
||||
private static final LoadingCache<String, Texture> _CACHE = CacheBuilder.newBuilder().softValues().build(new ImageLoader());
|
||||
private static final Texture _defaultImage;
|
||||
static {
|
||||
Texture defImage = new Texture(Gdx.files.internal(Constants.DEFAULT_DUELS_DIR));
|
||||
Texture defImage = null;
|
||||
try {
|
||||
defImage = new Texture(Gdx.files.internal(Constants.DEFAULT_DUELS_DIR));
|
||||
defImage = new Texture(Gdx.files.internal(Constants.NO_CARD_FILE));
|
||||
} catch (Exception ex) {
|
||||
System.err.println("could not load default card image");
|
||||
} finally {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package forge.toolbox;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
|
||||
import forge.Forge.Graphics;
|
||||
import forge.assets.ImageCache;
|
||||
import forge.game.card.Card;
|
||||
|
||||
public class FCardPanel extends FDisplayObject {
|
||||
@@ -25,14 +24,6 @@ public class FCardPanel extends FDisplayObject {
|
||||
w = h / ASPECT_RATIO;
|
||||
}
|
||||
|
||||
if (card.isCreature()) { //TODO: Render actual card image
|
||||
g.fillRect(Color.BLUE, x, y, w, h);
|
||||
}
|
||||
else if (card.isLand()) {
|
||||
g.fillRect(Color.GREEN, x, y, w, h);
|
||||
}
|
||||
else {
|
||||
g.fillRect(Color.RED, x, y, w, h);
|
||||
}
|
||||
g.drawImage(ImageCache.getImage(card), x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user