Format
typescript
Texture2D.GetPixels(x, y, blockWidth, blockHeight, mipLevel)class: Texture2D
Description
Get the pixel color of a specific area on a texture.
It can be used to read the color information of a specific area in a texture, allowing you to retrieve the pixel data of the texture at runtime.
Parameters
| param_name | type | description |
|---|---|---|
| x | number | The x-axis coordinate. |
| y | number | The y-axis coordinate. |
| blockWidth | number | The width of the area to be retrieved. |
| blockHeight | number | The height of the area to be retrieved. |
| mipLevel | number? | The mip level of the texture. |
Return
| type | description |
|---|---|
Color|undefined | An array of pixel colors. |
