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