Skip to content

Instantly share code, notes, and snippets.

View ImMichey's full-sized avatar

Michael Nickel ImMichey

View GitHub Profile
@ImMichey
ImMichey / gist:87cf6643691c1d892e261c266b3d8850
Created October 7, 2020 22:51
LibGDX 2D shadows with affines
/*
* Creates a custom Affine2 for shadows with rotation
*
* x, y --> position in world (usually the entity position)
* rotation --> angle in degrees
* offsetX, offsetY --> if the original sprite is drawn with an offset
* originX, originY --> center of the sprite
* shearX, shearY --> shear amount (usually day/night cycle shear values)
* scaleX, scaleY --> scale amount (usually day/night cycle scale values)
*/