MCPcopy Create free account
hub / github.com/Card-Forge/forge / drawCardImage

Method drawCardImage

forge-gui-mobile/src/forge/Graphics.java:815–836  ·  view source on GitHub ↗
(FImage image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGrayscale, boolean damaged)

Source from the content-addressed store, hash-verified

813 }
814
815 public void drawCardImage(FImage image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGrayscale, boolean damaged) {
816 if (image == null)
817 return;
818 if (!drawGrayscale) {
819 image.draw(this, x, y, w, h);
820 if (damage_overlay != null && damaged)
821 batch.draw(damage_overlay, adjustX(x), adjustY(y, h), w, h);
822 } else {
823 batch.end();
824 shaderGrayscale.bind();
825 shaderGrayscale.setUniformf("u_grayness", 1f);
826 shaderGrayscale.setUniformf("u_bias", 0.8f);
827 batch.setShader(shaderGrayscale);
828 batch.begin();
829 //draw gray
830 image.draw(this, x, y, w, h);
831 //reset
832 batch.end();
833 batch.setShader(null);
834 batch.begin();
835 }
836 }
837
838 public void drawCardImage(Texture image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGrayscale, boolean damaged) {
839 if (!drawGrayscale) {

Callers

nothing calls this directly

Calls 5

adjustXMethod · 0.95
adjustYMethod · 0.95
drawMethod · 0.65
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected