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

Method drawPixelated

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

Source from the content-addressed store, hash-verified

1124 }
1125
1126 public void drawPixelated(FImage image, float x, float y, float w, float h, Float amount, boolean flipY) {
1127 if (image == null)
1128 return;
1129 if (amount != null) {
1130 batch.end();
1131 shaderPixelate.bind();
1132 shaderPixelate.setUniformf("u_resolution", Forge.isLandscapeMode() ? w : h, Forge.isLandscapeMode() ? h : w);
1133 shaderPixelate.setUniformf("u_cellSize", amount);
1134 shaderPixelate.setUniformf("u_yflip", flipY ? 1f : 0f);
1135 shaderPixelate.setUniformf("u_bias", 0.7f);
1136 batch.setShader(shaderPixelate);
1137 batch.begin();
1138 //draw
1139 image.draw(this, x, y, w, h);
1140 //reset
1141 batch.end();
1142 batch.setShader(null);
1143 batch.begin();
1144 } else {
1145 drawImage(image, x, y, w, h);
1146 }
1147 }
1148
1149 public void drawPixelated(TextureRegion image, float x, float y, float w, float h, Float amount, boolean flipY) {
1150 if (image == null)

Callers

nothing calls this directly

Calls 5

isLandscapeModeMethod · 0.95
drawImageMethod · 0.95
drawMethod · 0.65
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected