FlixelShakeable
View sourceinterface
org.flixelgdx.functional.FlixelShakeable
Something FlixelShakeTween can jitter and restore without caring whether the underlying channel is a sprite graphic offset, a world position, or a desktop window position.
Implementations choose what X and Y mean: FlixelSprite uses graphic offset; FlixelObject uses world position; FlixelWindow uses window placement in screen coordinates.
See Also: FlixelShakeTween
Methods
getShakeX()
Current shake channel X (for example graphic offset or world X).
Returns: Shake X before jitter is applied.
getShakeY()
Current shake channel Y.
Returns: Shake Y before jitter is applied.
setShake(float, float)
Sets the shake channel to absolute coordinates (typically base plus jitter).
Parameters:
| Name | Description |
|---|---|
x | New shake X. |
y | New shake Y. |
getShakeWidth()
Width used to scale FlixelShakeUnit.FRACTION on the X axis. Values 0 or less mean the tween treats intensity like plain pixels on that axis.
Returns: Reference width for fractional shake, or non-positive to fall back.
getShakeHeight()
Height used to scale FlixelShakeUnit.FRACTION on the Y axis. Values 0 or less mean the tween treats intensity like plain pixels on that axis.
Returns: Reference height for fractional shake, or non-positive to fall back.
shakeFractionWidthFromGraphics()
Convenience default for fullscreen targets: uses the back buffer size when libGDX graphics is available.
Returns: Positive width in pixels, or 0f if unknown.
shakeFractionHeightFromGraphics()
Convenience default for fullscreen targets: uses the back buffer size when libGDX graphics is available.
Returns: Positive height in pixels, or 0f if unknown.