Class: Live2DTransform
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4284
Useless class. May be useful in the future.
Extends
Transform
Constructors
Constructor
> new Live2DTransform(options?): Live2DTransform
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:136
Parameters
options?
TransformOptions
Options for the transform.
Returns
Live2DTransform
Inherited from
Transform.constructor
Properties
_cx
> protected _cx: number
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:113
The X-coordinate value of the normalized local X axis, the first column of the local transformation matrix without a scale.
Inherited from
Transform._cx
_cy
> protected _cy: number
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:123
The X-coordinate value of the normalized local Y axis, the second column of the local transformation matrix without a scale.
Inherited from
Transform._cy
_matrix
> _matrix: Matrix
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:55
Internal
The local transformation matrix.
Inherited from
Transform._matrix
_rotation
> protected _rotation: number
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:108
The rotation amount.
Inherited from
Transform._rotation
_sx
> protected _sx: number
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:118
The Y-coordinate value of the normalized local X axis, the first column of the local transformation matrix without a scale.
Inherited from
Transform._sx
_sy
> protected _sy: number
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:128
The Y-coordinate value of the normalized local Y axis, the second column of the local transformation matrix without a scale.
Inherited from
Transform._sy
dirty
> protected dirty: boolean
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:129
Inherited from
Transform.dirty
observer
> protected observer: Observer<Transform>
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:130
Inherited from
Transform.observer
pivot
> pivot: ObservablePoint
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:94
The pivot point of the container that it rotates around.
Example
// Center pivot
transform.pivot.set(sprite.width / 2, sprite.height / 2);
// Corner rotation
transform.pivot.set(0, 0);
transform.rotation = Math.PI / 4; // 45 degreesInherited from
Transform.pivot
position
> position: ObservablePoint
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:68
The coordinate of the object relative to the local coordinates of the parent.
Example
// Basic position setting
transform.position.set(100, 100);
// Individual coordinate access
transform.position.x = 50;
transform.position.y = 75;Inherited from
Transform.position
scale
> scale: ObservablePoint
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:81
The scale factor of the object.
Example
// Uniform scaling
transform.scale.set(2, 2);
// Non-uniform scaling
transform.scale.x = 2; // Stretch horizontally
transform.scale.y = 0.5; // Compress verticallyInherited from
Transform.scale
skew
> skew: ObservablePoint
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:106
The skew amount, on the x and y axis.
Example
// Apply horizontal skew
transform.skew.x = Math.PI / 6; // 30 degrees
// Apply both skews
transform.skew.set(Math.PI / 6, Math.PI / 8);Inherited from
Transform.skew
Accessors
matrix
Get Signature
> get matrix(): Matrix
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:150
The transformation matrix computed from the transform's properties. Combines position, scale, rotation, skew, and pivot into a single matrix.
Example
// Get current matrix
const matrix = transform.matrix;
console.log(matrix.toString());See
- Matrix For matrix operations
- Transform.setFromMatrix For setting transform from matrix
Returns
Matrix
Inherited from
Transform.matrix
rotation
Get Signature
> get rotation(): number
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:199
The rotation of the object in radians.
Example
// Basic rotation
transform.rotation = Math.PI / 4; // 45 degrees
// Rotate around pivot point
transform.pivot.set(50, 50);
transform.rotation = Math.PI; // 180 degrees around pivot
// Animate rotation
app.ticker.add(() => {
transform.rotation += 0.1;
});See
- Transform#pivot For rotation point
- Transform#skew For skew effects
Returns
number
Set Signature
> set rotation(value): void
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:200
Parameters
value
number
Returns
void
Inherited from
Transform.rotation
Methods
_onUpdate()
> _onUpdate(point?): void
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:156
Internal
Called when a value changes.
Parameters
point?
ObservablePoint
Returns
void
Inherited from
Transform._onUpdate
setFromMatrix()
> setFromMatrix(matrix): void
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:179
Decomposes a matrix and sets the transforms properties based on it.
Parameters
matrix
Matrix
The matrix to decompose
Returns
void
Example
// Basic matrix decomposition
const transform = new Transform();
const matrix = new Matrix()
.translate(100, 100)
.rotate(Math.PI / 4)
.scale(2, 2);
transform.setFromMatrix(matrix);
console.log(transform.position.x); // 100
console.log(transform.rotation); // ~0.785 (π/4)See
- Matrix#decompose For the decomposition logic
- Transform#matrix For getting the current matrix
Inherited from
Transform.setFromMatrix
toString()
> toString(): string
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:159
Returns
string
Inherited from
Transform.toString
updateSkew()
> protected updateSkew(): void
Defined in: node_modules/pixi.js/lib/utils/misc/Transform.d.ts:158
Called when the skew or the rotation changes.
Returns
void
Inherited from
Transform.updateSkew