Package tripleplay.particle.init
Class Transform
java.lang.Object
tripleplay.particle.init.Transform
Initializers for a particle's transform (scale, rotation and position).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Initializer
constant
(float tx, float ty) Returns an initializer that configures a particle with a constant translation, and no scaling or rotation.static Initializer
constant
(float scale, float rot, float tx, float ty) Returns an initializer that configures a particle with a constant transform.static Initializer
identity()
Returns an initialize that configures a particle to the identity transform.static Initializer
Returns an initializer that configures a particle with the same transform (scale, rotation, position) as the supplied layer.static Initializer
randomOffset
(Randoms rando, float noise) Returns an initializer that adjusts the particle's position randomly from its current location by up tonoise
units in both x and y.static Initializer
Returns an initializer that configures a particle's position in a random region.static Initializer
randomScale
(Randoms rando, float minScale, float maxScale) Returns an initializer that scales its previously assigned transform by an evenly distributed random amount within the specified range.static Initializer
scale
(float scale) Returns an initializer that scales its previously assigned transform.
-
Constructor Details
-
Transform
public Transform()
-
-
Method Details
-
identity
Returns an initialize that configures a particle to the identity transform. This is generally registered prior to an initializer that updates some specific other part of the transform. -
constant
Returns an initializer that configures a particle with a constant translation, and no scaling or rotation. -
constant
Returns an initializer that configures a particle with a constant transform. -
scale
Returns an initializer that scales its previously assigned transform. -
randomScale
Returns an initializer that scales its previously assigned transform by an evenly distributed random amount within the specified range. -
layer
Returns an initializer that configures a particle with the same transform (scale, rotation, position) as the supplied layer. This will be the fully computed transform, not the layer's local transform. -
randomPos
Returns an initializer that configures a particle's position in a random region. The scale and rotation are not initialized, so this should be used withidentity()
. -
randomOffset
Returns an initializer that adjusts the particle's position randomly from its current location by up tonoise
units in both x and y.
-