RSX Code Reference
    Preparing search index...
    • rsx
    • Transform2D

    Class Transform2D

    . The Transform2D contains information about 2D object's position, rotation and scale. The class follows the 'copy-on-write' pattern, which means that every operation returns a copy of the transform with updated values. It also implies that the values of the transform cannot be directly modified.

    The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.

    Index
    _rotation: number
    _scale: Vector2
    _translation: Vector2
    • get rotation(): number

      Represents the rotation component of the transform.

      Returns number

    • set rotation(value: number): void

      Parameters

      • value: number

      Returns void

    • get scale(): Vector2

      Represents the scaling component of the transform.

      Returns Vector2

    • set scale(value: Immutable<Vector2>): void

      Parameters

      Returns void

    • get translation(): Vector2

      Represents the translation component of the transform.

      Returns Vector2

    • set translation(value: Immutable<Vector2>): void

      Parameters

      Returns void

    • Clones this instance and returns a new Transform2D with identical values.

      Returns Transform2D

    • Returns a string representation of an object.

      Returns string