Class AffineTransformBuilder Stay organized with collections Save and categorize content based on your preferences.
Page Summary
AffineTransformBuilder is used to build AffineTransform objects and defaults to the identity transform.
Call the
build()method to get the AffineTransform object.Methods are available to set scaling, shearing, and translation elements for both X and Y coordinates.
A builder forAffine objects. Defaults to the identity transform.
CallAffine to get theAffine object.
const transform = SlidesApp.newAffineTransformBuilder().setScaleX(2.0).setShearY(1.1).build();// The resulting transform matrix is// [ 2.0 0.0 0.0 ]// [ 1.1 1.0 0.0 ]// [ 0 0 1 ]}
Methods
| Method | Return type | Brief description |
|---|---|---|
build() | Affine | Creates anAffine object initialized with the elements set in the builder. |
set | Affine | Sets the X coordinate scaling element and returns the builder. |
set | Affine | Sets the Y coordinate scaling element and returns the builder. |
set | Affine | Sets the X coordinate shearing element and returns the builder. |
set | Affine | Sets the Y coordinate shearing element and returns the builder. |
set | Affine | Sets the X coordinate translation element in points, and returns the builder. |
set | Affine | Sets the Y coordinate translation element in points, and returns the builder. |
Detailed documentation
build()
Creates anAffine object initialized with the elements set in the builder.
Return
setScaleX(scaleX)
Sets the X coordinate scaling element and returns the builder.
Parameters
| Name | Type | Description |
|---|---|---|
scaleX | Number |
Return
setScaleY(scaleY)
Sets the Y coordinate scaling element and returns the builder.
Parameters
| Name | Type | Description |
|---|---|---|
scaleY | Number |
Return
setShearX(shearX)
Sets the X coordinate shearing element and returns the builder.
Parameters
| Name | Type | Description |
|---|---|---|
shearX | Number |
Return
setShearY(shearY)
Sets the Y coordinate shearing element and returns the builder.
Parameters
| Name | Type | Description |
|---|---|---|
shearY | Number |
Return
setTranslateX(translateX)
Sets the X coordinate translation element in points, and returns the builder.
Parameters
| Name | Type | Description |
|---|---|---|
translateX | Number |
Return
setTranslateY(translateY)
Sets the Y coordinate translation element in points, and returns the builder.
Parameters
| Name | Type | Description |
|---|---|---|
translateY | Number |
Return
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.