Skip to content
On this page

Class: Matrix

transform矩阵计算

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Matrix()

Properties

angle

angle: number = 0

旋转角度

Defined in

src/core/math/Matrix.ts:61


offset

offset: Vector2

锚点

Defined in

src/core/math/Matrix.ts:36


scale

scale: Vector2

缩放

Defined in

src/core/math/Matrix.ts:41


size

size: Vector2

大小,可用于计算锚点

Defined in

src/core/math/Matrix.ts:31


skewX

skewX: number = 0

倾斜,未实现

Defined in

src/core/math/Matrix.ts:50


skewY

skewY: number = 0

Defined in

src/core/math/Matrix.ts:51


translate

translate: Vector2

位置,移动

Defined in

src/core/math/Matrix.ts:56


value

value: [number, number, number, number, number, number, number, number, number]

Defined in

src/core/math/Matrix.ts:22

Methods

append

append(matrix): Matrix

Parameters

NameType
matrixMatrix

Returns

Matrix

Defined in

src/core/math/Matrix.ts:113


clone

clone(): Matrix

克隆当前矩阵

Returns

Matrix

Defined in

src/core/math/Matrix.ts:172


get

get(): [number, number, number, number, number, number, number, number, number]

获取矩阵数据

Returns

[number, number, number, number, number, number, number, number, number]

Defined in

src/core/math/Matrix.ts:182


prepend

prepend(matrix): Matrix

Parameters

NameType
matrixMatrix

Returns

Matrix

Defined in

src/core/math/Matrix.ts:130


rotate

rotate(angle): Matrix

旋转

Parameters

NameType
anglenumber

Returns

Matrix

Defined in

src/core/math/Matrix.ts:188


set

set(...args): void

设置矩阵数据

Parameters

NameType
...args[number, number, number, number, number, number, number, number, number]

Returns

void

Defined in

src/core/math/Matrix.ts:109


setTransform

setTransform(transform): Matrix

设置节点信息

Parameters

NameTypeDescription
transformTransform<Container>节点

Returns

Matrix

Defined in

src/core/math/Matrix.ts:67