TextureScaleOffsetProperty
Draws tiling and offset properties for a texture, using automatic GUI layout.
Read time 2 minutesLast updated 21 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
TextureScaleOffsetProperty(MaterialProperty)
Draws tiling and offset properties for a texture, using automatic GUI layout.
public void TextureScaleOffsetProperty(MaterialProperty property)
Parameters
Property to draw.
Remarks
This is similar to MaterialEditor.TextureScaleOffsetProperty(Rect, MaterialProperty), except the rect is determined automatically.
TextureScaleOffsetProperty(Rect, MaterialProperty)
Draws the tiling and offset fields of a texture property, as part of a texture property control.
public float TextureScaleOffsetProperty(Rect position, MaterialProperty property)
Parameters
The position and size of the control.
The texture property to draw the fields for.
Returns
Type | Description |
|---|---|
| float | The height, in pixels, that the control uses. |
Remarks
This overload draws the fields as part of a large texture property control. To draw them separately, use the overload that takes .
partOfTexturePropertyControlTextureScaleOffsetProperty(Rect, MaterialProperty, bool)
Draws the tiling and offset fields of a texture property, either inside a texture property control or separately.
public float TextureScaleOffsetProperty(Rect position, MaterialProperty property, bool partOfTexturePropertyControl)
Parameters
The position and size of the control.
The texture property to draw the fields for.
Set to true to draw the fields as part of a large texture property control. Set to false to draw them separately.
Returns
Type | Description |
|---|---|
| float | The height, in pixels, that the control uses. |
TextureScaleOffsetProperty(Rect, Vector4)
Draws separate tiling and offset fields for explicit values instead of a material property.
public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset)
Parameters
Returns
Type | Description |
|---|---|
| Vector4 | The tiling and offset values, which might have changed if the user interacted with the fields. |
Remarks
This overload draws the fields separately, not as part of a texture property control. To draw them inside a texture property control, use the overload that takes .
partOfTexturePropertyControlTextureScaleOffsetProperty(Rect, Vector4, bool)
Draws tiling and offset fields for explicit values, either inside a texture property control or separately.
public static Vector4 TextureScaleOffsetProperty(Rect position, Vector4 scaleOffset, bool partOfTexturePropertyControl)
Parameters
The position and size of the control.
The tiling and offset values, packed into a as tiling x, tiling y, offset x, offset y.
Vector4Set to true to draw the fields as part of a large texture property control. Set to false to draw them separately.
Returns
Type | Description |
|---|---|
| Vector4 | The tiling and offset values, which might have changed if the user interacted with the fields. |