Inherits from NSObject
Declared in PXTransform.h
PXTransform.m

Overview

Describes the local transformation of a PXDisplayObject in two-dimensional space and color space.

PXTransform also provides methods for finding the PXDisplayObject ’s transformation in global (stage) coordinate space.

The two-dimensional transformation (translation, scale, rotation and skew) of the associated PXDisplayObject can be read and set via the matrix property.

The color transformation of the associated PXDisplayObject can be read and set via the colorTransform property.

Tasks

Properties

colorTransform

The color transformation of the associated PXDisplayObject in local color space.

@property (nonatomic, copy) PXColorTransform *colorTransform

Discussion

Note that the colorTransform property returns a copy of itself and creates a copy of values assigned to it. That means that the color transformation of a PXDisplayObject can’t be set by dereferencing transform.colorTransform. Instead a PXColorTransform object containing the new values and must be re-assigned to the colorTransform property.

Wrong:

// This would have no effect on the display object.
displayObject.transform.colorTransform.redMultiplier = 0.5f;

Right:

PXColorTransform *colorTransform = displayObject.transform.colorTransform;
colorTransform.redMultiplier = 0.5f;
// This would work.
displayObject.transform.colorTransform = colorTransform;

Declared In

PXTransform.h

concatenatedColorTransform

The color transform combined with all of the PXDisplayObject ’s parents.

@property (nonatomic, readonly) PXColorTransform *concatenatedColorTransform

Discussion

It essentially describes the color transformation of the PXDisplayObject in global (stage) color space.

Declared In

PXTransform.h

concatenatedMatrix

The matrix values combined with all of the PXDisplayObject ’s parents. Describes the transformation of the PXDisplayObject in global (stage) coordinates.

@property (nonatomic, readonly) PXMatrix *concatenatedMatrix

Declared In

PXTransform.h

matrix

A matrix containing the local transformation of the PXDisplayObject associated with the given PXTransform.

@property (nonatomic, copy) PXMatrix *matrix

Discussion

Note that the matrix property returns a copy of itself and creates a copy of values assigned to it. That means that transformation of a PXDisplayObject can’t be set by dereferencing transform.matrix. Instead a PXMatrix object containing the new values and must be re-assigned to the matrix property.

Wrong:

// This would have no effect.
displayObject.transform.matrix.a = 5;

Right:

PXMatrix *matrix = displayObject.transform.matrix;
matrix.a = 5;
// This would work.
displayObject.transform.matrix = matrix;

Declared In

PXTransform.h

pixelBounds

A rectangle that defines the axis-aligned bounds the PXDisplayObject associated with the transform on the stage, in points.

@property (nonatomic, readonly) PXRectangle *pixelBounds

Declared In

PXTransform.h