(FImage image, float x, float y, float w, float h, boolean drawGrayscale, float amount)
| 778 | } |
| 779 | |
| 780 | public void drawAvatarImage(FImage image, float x, float y, float w, float h, boolean drawGrayscale, float amount) { |
| 781 | if (image == null) |
| 782 | return; |
| 783 | if (amount > 0) { |
| 784 | batch.end(); |
| 785 | shaderWarp.bind(); |
| 786 | shaderWarp.setUniformf("u_amount", 0.2f); |
| 787 | shaderWarp.setUniformf("u_speed", 0.2f); |
| 788 | shaderWarp.setUniformf("u_time", amount); |
| 789 | batch.setShader(shaderWarp); |
| 790 | batch.begin(); |
| 791 | //draw |
| 792 | image.draw(this, x, y, w, h); |
| 793 | //reset |
| 794 | batch.end(); |
| 795 | batch.setShader(null); |
| 796 | batch.begin(); |
| 797 | } else if (!drawGrayscale) { |
| 798 | image.draw(this, x, y, w, h); |
| 799 | } else { |
| 800 | batch.end(); |
| 801 | shaderGrayscale.bind(); |
| 802 | shaderGrayscale.setUniformf("u_grayness", 1f); |
| 803 | shaderGrayscale.setUniformf("u_bias", 1f); |
| 804 | batch.setShader(shaderGrayscale); |
| 805 | batch.begin(); |
| 806 | //draw gray |
| 807 | image.draw(this, x, y, w, h); |
| 808 | //reset |
| 809 | batch.end(); |
| 810 | batch.setShader(null); |
| 811 | batch.begin(); |
| 812 | } |
| 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) |
no test coverage detected