(final Graphics g, final float w, final float h)
| 142 | public ISkinImage createLayeredImage(final PaperCard paperCard, final FSkinProp background, final String overlayFilename, final float opacity) { |
| 143 | return new FBufferedImage(background.getWidth(), background.getHeight(), opacity) { |
| 144 | @Override |
| 145 | protected void draw(final Graphics g, final float w, final float h) { |
| 146 | g.drawImage(FSkin.getImages().get(background), 0, 0, background.getWidth(), background.getHeight()); |
| 147 | final float cardImageWidth = 90f; |
| 148 | final float cardImageHeight = 128f; |
| 149 | |
| 150 | if (FileUtil.doesFileExist(overlayFilename)) { |
| 151 | try { |
| 152 | final Texture overlay = Forge.getAssets().getTexture(Gdx.files.absolute(overlayFilename)); |
| 153 | g.drawImage(overlay, (background.getWidth() - overlay.getWidth()) / 2f, (background.getHeight() - overlay.getHeight()) / 2f, overlay.getWidth(), overlay.getHeight()); |
| 154 | } catch (Exception ignored) { |
| 155 | } |
| 156 | } else if (paperCard != null) { |
| 157 | Texture cardImage = ImageCache.getInstance().getImage(paperCard.getCardImageKey(), false); |
| 158 | if (cardImage != null) |
| 159 | g.drawCardRoundRect(cardImage, null, (background.getWidth() - cardImageWidth) / 2, (background.getHeight() - cardImageHeight) / 3.8f, cardImageWidth, cardImageHeight, false, false, paperCard.isFoil()); |
| 160 | } |
| 161 | |
| 162 | Gdx.graphics.requestRendering(); //ensure image appears right away |
| 163 | } |
| 164 | }; |
| 165 | } |
| 166 |
nothing calls this directly
no test coverage detected