| 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); |