GroupShader, LinearShader, PixelMapShader, RadialShader, SweepShaderpublic abstract class Shader extends Object
This class creates a shader based on the specified TileMode, colors, and shading area.
The created shader shades colors on a drawn object.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
Shader.TileMode |
Specifies how to shade colors on the part outside of the shading area defined by the
Shader. |
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
int[] |
intColors |
Indicates the int values representing the shading colors of this shader.
|
protected int |
mTileMode |
Indicates the
tileMode attribute of the current Shader object. |
Color[] |
shaderColors |
Indicates the array of shading colors of this shader.
|
| 构造器 | 说明 |
|---|---|
Shader(Color[] colors,
Shader.TileMode newTileMode) |
A parameterized constructor used to create a
Shader instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Color[] |
getShaderColors() |
Obtains the array of shading colors of this
Shader. |
Shader.TileMode |
getTileMode() |
Obtains the
TileMode attribute of this Shader. |
void |
setShaderMatrix(Matrix matrix) |
Set shader's matrix.
|
public int[] intColors
intColors for other methods to use.protected int mTileMode
tileMode attribute of the current Shader object.public Color[] shaderColors
public Shader(Color[] colors, Shader.TileMode newTileMode)
Shader instance.
This constructor stores the input array of shading colors and the tile mode in the Shader attributes.
The array of shading colors will be converted into int values for other methods to use.
colors - Indicates the array of shading colors.newTileMode - Indicates the tile mode used to shade colors when the drawn object exceeds the shading area
defined by the shader.public Shader.TileMode getTileMode()
TileMode attribute of this Shader.
The tile mode specifies how to shade colors on the part outside of the shading area defined by the shader.
The tile mode can be TileMode#CLAMP_TILEMODE, TileMode#REPEAT_TILEMODE, or
TileMode#MIRROR_TILEMODE.
public Color[] getShaderColors()
Shader.Shader#shaderColors of the Shader.public void setShaderMatrix(Matrix matrix)
Clean the native shader object if the param is null or identity.
matrix - Indicates the local matrix need to be set.