MCPcopy
hub / github.com/libgdx/libgdx / flip

Method flip

gdx/src/com/badlogic/gdx/graphics/g2d/Sprite.java:707–726  ·  view source on GitHub ↗

boolean parameters x,y are not setting a state, but performing a flip @param x perform horizontal flip @param y perform vertical flip

(boolean x, boolean y)

Source from the content-addressed store, hash-verified

705 * @param x perform horizontal flip
706 * @param y perform vertical flip */
707 public void flip (boolean x, boolean y) {
708 super.flip(x, y);
709 float[] vertices = Sprite.this.vertices;
710 if (x) {
711 float temp = vertices[U1];
712 vertices[U1] = vertices[U3];
713 vertices[U3] = temp;
714 temp = vertices[U2];
715 vertices[U2] = vertices[U4];
716 vertices[U4] = temp;
717 }
718 if (y) {
719 float temp = vertices[V1];
720 vertices[V1] = vertices[V3];
721 vertices[V3] = temp;
722 temp = vertices[V2];
723 vertices[V2] = vertices[V4];
724 vertices[V4] = temp;
725 }
726 }
727
728 public void scroll (float xAmount, float yAmount) {
729 float[] vertices = Sprite.this.vertices;

Callers 15

setFlipMethod · 0.95
IndexArrayMethod · 0.45
setIndicesMethod · 0.45
setVerticesMethod · 0.45
setIndicesMethod · 0.45
IndexBufferObjectMethod · 0.45
setIndicesMethod · 0.45
deleteVAOMethod · 0.45
transferMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected