Documentation

Unity Engine

Unity Engine

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

position

The position and size of the control.

The texture property to draw the fields for.

Returns

Type

Description

floatThe 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
partOfTexturePropertyControl
.

TextureScaleOffsetProperty(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

position

The position and size of the control.

The texture property to draw the fields for.

partOfTexturePropertyControl

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

floatThe 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

position

The position and size of the control.

scaleOffset

The tiling and offset values, packed into a
Vector4
as tiling x, tiling y, offset x, offset y.

Returns

Type

Description

Vector4The 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
partOfTexturePropertyControl
.

TextureScaleOffsetProperty(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

position

The position and size of the control.

scaleOffset

The tiling and offset values, packed into a
Vector4
as tiling x, tiling y, offset x, offset y.

partOfTexturePropertyControl

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

Vector4The tiling and offset values, which might have changed if the user interacted with the fields.