Control for drawing textures.
    public class TextureRect : Control

Used to draw icons and sprites in a user interface. The texture’s placement can be controlled with the StretchMode property. It can scale, tile, or stay centered inside its bounding rectangle.

Inheritance Chain

Constructors

    public TextureRect()

Properties

    public bool Expand { get; set; }

If true, the texture scales to fit its bounding rectangle.

    public bool FlipH { get; set; }

If true, texture is flipped horizontally.

    public bool FlipV { get; set; }

If true, texture is flipped vertically.

    public StretchModeEnum StretchMode { get; set; }

Controls the texture’s behavior when resizing the node’s bounding rectangle. See StretchMode.

    public Texture Texture { get; set; }

The node’s Texture resource.

Methods

    [Obsolete("GetStretchMode is deprecated. Use the StretchMode property instead.")]
    public StretchModeEnum GetStretchMode()

Getter for StretchMode

    [Obsolete("GetTexture is deprecated. Use the Texture property instead.")]
    public Texture GetTexture()

Getter for Texture

    [Obsolete("HasExpand is deprecated. Use the Expand property instead.")]
    public bool HasExpand()

Getter for Expand

    [Obsolete("IsFlippedH is deprecated. Use the FlipH property instead.")]
    public bool IsFlippedH()

Getter for FlipH

    [Obsolete("IsFlippedV is deprecated. Use the FlipV property instead.")]
    public bool IsFlippedV()

Getter for FlipV

    [Obsolete("SetExpand is deprecated. Use the Expand property instead.")]
    public void SetExpand(bool enable)

Setter for Expand

    [Obsolete("SetFlipH is deprecated. Use the FlipH property instead.")]
    public void SetFlipH(bool enable)

Setter for FlipH

    [Obsolete("SetFlipV is deprecated. Use the FlipV property instead.")]
    public void SetFlipV(bool enable)

Setter for FlipV

    [Obsolete("SetStretchMode is deprecated. Use the StretchMode property instead.")]
    public void SetStretchMode(StretchModeEnum stretchMode)

Setter for StretchMode

    [Obsolete("SetTexture is deprecated. Use the Texture property instead.")]
    public void SetTexture(Texture texture)

Setter for Texture

Inner Types

StretchModeEnum

Name Value Description
ScaleOnExpand 0 Scale to fit the node’s bounding rectangle, only if [code]expand[/code] is [code]true[/code]. Default [code]stretch_mode[/code], for backwards compatibility. Until you set [code]expand[/code] to [code]true[/code], the texture will behave like [constant STRETCH_KEEP].
Scale 1 Scale to fit the node’s bounding rectangle.
Tile 2 Tile inside the node’s bounding rectangle.
Keep 3 The texture keeps its original size and stays in the bounding rectangle’s top-left corner.
KeepCentered 4 The texture keeps its original size and stays centered in the node’s bounding rectangle.
KeepAspect 5 Scale the texture to fit the node’s bounding rectangle, but maintain the texture’s aspect ratio.
KeepAspectCentered 6 Scale the texture to fit the node’s bounding rectangle, center it and maintain its aspect ratio.
KeepAspectCovered 7 Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node’s limits.
Tags: