Skip to content

TextureButton StretchModeEnum

Eduard Gushchin edited this page Jun 22, 2026 · 3 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.TextureButton.StretchModeEnum
Namespace Electron2D
Kind enum
Category UI and Text

Overview

Identifies how a texture button scales its selected texture.

Syntax

public enum Electron2D.TextureButton.StretchModeEnum : System.IComparable, System.IConvertible, System.IFormattable, System.ISpanFormattable

Remarks

The values use the same numeric order as Electron2D.TextureRect.StretchModeEnum.

Thread Safety

This enum is immutable and is safe to use from any thread.

Since

This enum is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchMode

Members

Member Kind Summary
Keep Enum value Keeps the texture size at the top-left corner.
KeepAspect Enum value Fits the texture inside the control while preserving aspect ratio.
KeepAspectCentered Enum value Fits the texture inside the control and centers it.
KeepAspectCovered Enum value Covers the control while preserving aspect ratio.
KeepCentered Enum value Keeps the texture size and centers it.
Scale Enum value Scales the texture to the control rectangle.
Tile Enum value Draws the texture in the control rectangle.

Member Details

Keep

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum Keep

Summary

Keeps the texture size at the top-left corner.

Remarks

Use this value to avoid scaling.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

KeepAspect

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum KeepAspect

Summary

Fits the texture inside the control while preserving aspect ratio.

Remarks

Use this value when clipping is not desired.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

KeepAspectCentered

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum KeepAspectCentered

Summary

Fits the texture inside the control and centers it.

Remarks

Use this value for centered aspect-ratio drawing.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

KeepAspectCovered

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum KeepAspectCovered

Summary

Covers the control while preserving aspect ratio.

Remarks

The destination rectangle can extend outside the control area.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

KeepCentered

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum KeepCentered

Summary

Keeps the texture size and centers it.

Remarks

Use this value to draw fixed-size centered button art.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

Scale

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum Scale

Summary

Scales the texture to the control rectangle.

Remarks

Use this value with Electron2D.TextureButton.StretchMode.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

Tile

Kind: Enum value

public const Electron2D.TextureButton.StretchModeEnum Tile

Summary

Draws the texture in the control rectangle.

Remarks

Repeating tiles are not split into public draw calls.

Since

This value is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.TextureButton.StretchModeEnum

Clone this wiki locally