Skip to main content

FlixelShakeUnit

View source

enum

org.flixelgdx.tween.settings.FlixelShakeUnit

public final enum FlixelShakeUnit

How FlixelShakeTween.intensity maps to maximum offset per axis.

FlixelShakeUnit.FRACTION scales horizontal range by FlixelShakeable.getShakeWidth() and vertical range by FlixelShakeable.getShakeHeight() when those return values greater than zero (per axis enabled by FlixelAxes). Typical values are small, for example 0.05f.

FlixelShakeUnit.PIXELS sets the half-range in pixels on each active axis (random offset in [-intensity, +intensity]).

Fields

FRACTION

public static final FlixelShakeUnit FRACTION

Scale intensity by FlixelShakeable.getShakeWidth() (X) and FlixelShakeable.getShakeHeight() (Y) when positive. This is the default value.

Use this if you're familiar with HaxeFlixel and want to use the same behavior.


PIXELS

public static final FlixelShakeUnit PIXELS

Treat intensity as pixel magnitude on each shaken axis.

Use this if you want to directly set the half-range in pixels on each active axis (random offset in [-intensity, +intensity]) and you're used to how Unity or Godot shakes objects.


Methods

values()

public static FlixelShakeUnit[] values()

valueOf(String)

public static FlixelShakeUnit valueOf(String name)