Class Transform

java.lang.Object
tripleplay.particle.init.Transform

public class Transform extends Object
Initializers for a particle's transform (scale, rotation and position).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    constant(float tx, float ty)
    Returns an initializer that configures a particle with a constant translation, and no scaling or rotation.
    constant(float scale, float rot, float tx, float ty)
    Returns an initializer that configures a particle with a constant transform.
    Returns an initialize that configures a particle to the identity transform.
    layer(Layer layer)
    Returns an initializer that configures a particle with the same transform (scale, rotation, position) as the supplied layer.
    randomOffset(Randoms rando, float noise)
    Returns an initializer that adjusts the particle's position randomly from its current location by up to noise units in both x and y.
    randomPos(Randoms rando, float x, float y, float width, float height)
    Returns an initializer that configures a particle's position in a random region.
    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.
    scale(float scale)
    Returns an initializer that scales its previously assigned transform.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Transform

      public Transform()
  • Method Details

    • identity

      public static Initializer 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

      public static Initializer constant(float tx, float ty)
      Returns an initializer that configures a particle with a constant translation, and no scaling or rotation.
    • constant

      public static Initializer constant(float scale, float rot, float tx, float ty)
      Returns an initializer that configures a particle with a constant transform.
    • scale

      public static Initializer scale(float scale)
      Returns an initializer that scales its previously assigned transform.
    • randomScale

      public 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.
    • layer

      public static Initializer layer(Layer 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

      public static Initializer randomPos(Randoms rando, float x, float y, float width, float height)
      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 with identity().
    • randomOffset

      public static Initializer randomOffset(Randoms rando, float noise)
      Returns an initializer that adjusts the particle's position randomly from its current location by up to noise units in both x and y.