FillGradient
Describes a fill gradient used for rendering filled shapes in Painter2D. The start, end, center, focus, and radius properties are pixel coordinate relative to the painter's coordinate system.
阅读时间1 分钟最后更新于 24 天前
Definition
- Type: Struct
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
public struct FillGradient
Remarks
This struct encapsulates the data required to define a gradient fill, including the gradient itself, the type of gradient (linear or radial), and the parameters that control the direction or focus of the gradient.
Properties
Property | Description |
|---|---|
| addressMode | Specifies how the gradient is sampled when UV coordinates are outside the [0, 1] range. |
| center | The center point for a radial gradient. |
| end | The end point for a linear gradient. |
| focus | The Focus point for radial gradient. |
| gradient | The color gradient used for the fill. |
| gradientType | The type of gradient to use (linear or radial). |
| radius | The radius for a radial gradient. |
| start | The start point for a linear gradient. |
Static Methods
Method | Description |
|---|---|
| MakeLinearGradient | Helper method to create a linear gradient fill, using startColor and endColor to define the gradient. |
| MakeRadialGradient | Helper method to create a radial gradient fill, using startColor and endColor to define the gradient. |