# Transform:setMatrix

 Available since LÖVE 11.0 This function is not supported in earlier versions.

Directly sets the Transform's internal 4x4 transformation matrix.

## Function

### Synopsis

transform = Transform:setMatrix( e1_1, e1_2, ..., e4_4 )

### Arguments

number e1_1
The first column of the first row of the matrix.
number e1_2
The second column of the first row of the matrix.
number ...
number e4_4
The fourth column of the fourth row of the matrix.

### Returns

Transform transform
The Transform object the method was called on. Allows easily chaining Transform methods.

## Function

### Synopsis

transform = Transform:setMatrix( layout, e1_1, e1_2, ..., e4_4 )

### Arguments

MatrixLayout layout
How to interpret the matrix element arguments (row-major or column-major).
number e1_1
The first column of the first row of the matrix.
number e1_2
The second column of the first row or the first column of the second row of the matrix, depending on the specified layout.
number ...
number e4_4
The fourth column of the fourth row of the matrix.

### Returns

Transform transform
The Transform object the method was called on. Allows easily chaining Transform methods.

## Function

### Synopsis

transform = Transform:setMatrix( layout, matrix )

### Arguments

MatrixLayout layout
How to interpret the matrix element arguments (row-major or column-major).
table matrix
A flat table containing the 16 matrix elements.

### Returns

Transform transform
The Transform object the method was called on. Allows easily chaining Transform methods.

## Function

### Synopsis

transform = Transform:setMatrix( layout, matrix )

### Arguments

MatrixLayout layout
How to interpret the matrix element arguments (row-major or column-major).
table matrix
A table of 4 tables, with each sub-table containing 4 matrix elements.

### Returns

Transform transform
The Transform object the method was called on. Allows easily chaining Transform methods.