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

Method drawAvatarImage

forge-gui-mobile/src/forge/Graphics.java:780–813  ·  view source on GitHub ↗
(FImage image, float x, float y, float w, float h, boolean drawGrayscale, float amount)

Source from the content-addressed store, hash-verified

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)

Callers 2

drawAvatarMethod · 0.80
drawMethod · 0.80

Calls 3

drawMethod · 0.65
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected