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

Method drawCardRoundRect

forge-gui-mobile/src/forge/Graphics.java:955–977  ·  view source on GitHub ↗
(Texture image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGray, boolean damaged, boolean foilEffect)

Source from the content-addressed store, hash-verified

953 }
954
955 public void drawCardRoundRect(Texture image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGray, boolean damaged, boolean foilEffect) {
956 if (image == null)
957 return;
958 float radius = ImageCache.getInstance().getRadius(image);
959 batch.end();
960 shaderRoundedRect.bind();
961 shaderRoundedRect.setUniformf("u_resolution", image.getWidth(), image.getHeight());
962 shaderRoundedRect.setUniformf("edge_radius", (float)(image.getHeight() / image.getWidth()) * radius);
963 shaderRoundedRect.setUniformf("u_gray", drawGray ? 0.8f : 0f);
964 batch.setShader(shaderRoundedRect);
965 batch.begin();
966 //draw
967 batch.draw(image, adjustX(x), adjustY(y, h), w, h);
968 //reset
969 batch.end();
970 batch.setShader(null);
971 batch.begin();
972 if (foilEffect && !drawGray) {
973 drawFoil(x, y, w, h, radius);
974 }
975 if (damage_overlay != null && damaged)
976 batch.draw(damage_overlay, adjustX(x), adjustY(y, h), w, h);
977 }
978
979 public void drawCardRoundRect(Texture image, float x, float y, float w, float h, float originX, float originY, float rotation) {
980 drawCardRoundRect(image, x, y, w, h, originX, originY, rotation, 1f, false);

Callers 4

drawMethod · 0.80
drawCardMethod · 0.80
drawZoomMethod · 0.80
drawMethod · 0.80

Calls 11

getInstanceMethod · 0.95
adjustXMethod · 0.95
adjustYMethod · 0.95
drawFoilMethod · 0.95
drawRotatedImageMethod · 0.95
getRadiusMethod · 0.80
getWidthMethod · 0.65
getHeightMethod · 0.65
drawMethod · 0.65
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected