Class: Transform
变换矩阵
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- copy
- getMatrix
- getScale
- getTranslation
- identity
- invert
- multiply
- point
- points
- rotate
- rotateTarget
- scale
- setAbsolutePosition
- transform
- translate
- translateTo
- vec
Constructors
constructor
new Transform(m?
)
Parameters
Name | Type |
---|---|
m? | number [] |
Properties
height
height: number
= 1
m
m: number
[]
rotation
rotation: number
= 0
width
width: number
= 1
Accessors
scaleX
get
scaleX(): number
Returns
number
scaleY
get
scaleY(): number
Returns
number
skewX
get
skewX(): number
Returns
number
skewY
get
skewY(): number
Returns
number
x
get
x(): number
Returns
number
y
get
y(): number
Returns
number
Methods
copy
copy(): Transform
Returns
getMatrix
getMatrix(): number
[]
Returns
number
[]
getScale
getScale(): Object
Returns
Object
Name | Type |
---|---|
x | number |
y | number |
getTranslation
getTranslation(): Object
Returns
Object
Name | Type |
---|---|
x | number |
y | number |
identity
identity(): void
Returns
void
invert
invert(): Transform
Returns
multiply
multiply(target
): Transform
Parameters
Name | Type |
---|---|
target | Transform |
Returns
point
point(point
): Object
Parameters
Name | Type |
---|---|
point | PointLike |
Returns
Object
Name | Type |
---|---|
x | number |
y | number |
points
points(points
): any
[]
Parameters
Name | Type |
---|---|
points | any |
Returns
any
[]
rotate
rotate(rad
): Transform
Parameters
Name | Type |
---|---|
rad | any |
Returns
Implementation of
rotateTarget
rotateTarget(rad
, x
, y
): void
Parameters
Name | Type |
---|---|
rad | any |
x | any |
y | any |
Returns
void
scale
scale(sx
, sy
): Transform
Parameters
Name | Type |
---|---|
sx | any |
sy | any |
Returns
Implementation of
setAbsolutePosition
setAbsolutePosition(x
, y
): Transform
Parameters
Name | Type |
---|---|
x | any |
y | any |
Returns
transform
transform(scaleX
, skewX
, skewY
, scaleY
, x
, y
): void
Parameters
Name | Type |
---|---|
scaleX | any |
skewX | any |
skewY | any |
scaleY | any |
x | any |
y | any |
Returns
void
Implementation of
translate
translate(x
, y
): Transform
Parameters
Name | Type |
---|---|
x | any |
y | any |
Returns
Implementation of
translateTo
translateTo(x
, y
): Transform
Parameters
Name | Type |
---|---|
x | any |
y | any |
Returns
vec
vec(out
, v
): Vec2
Parameters
Name | Type |
---|---|
out | Vec2 |
v | Vec2 |