Class TextureRect

Namespace
Forma
Assembly
Forma.dll

Draws a texture with configurable scaling, aspect cropping, tiling, flipping, and size contribution.

public class TextureRect : Control, IAddChild<Control>, IAddChild, INotifyPropertyChanged
Inheritance
TextureRect
Implements
Derived
Inherited Members

Constructors

TextureRect()

public TextureRect()

Properties

ExpandMode

public TextureRectExpandMode ExpandMode { get; set; }

Property Value

TextureRectExpandMode

FlipH

public bool FlipH { get; set; }

Property Value

bool

FlipV

public bool FlipV { get; set; }

Property Value

bool

Modulate

public Color Modulate { get; set; }

Property Value

Color

StretchMode

public TextureStretchMode StretchMode { get; set; }

Property Value

TextureStretchMode

Texture

public Texture2D Texture { get; set; }

Property Value

Texture2D

Methods

DrawChildControls(UIRenderContext)

protected void DrawChildControls(UIRenderContext context)

Parameters

context UIRenderContext

GetExpandMode()

public TextureRectExpandMode GetExpandMode()

Returns

TextureRectExpandMode

GetMinimumSize()

public override Vector2 GetMinimumSize()

Returns

Vector2

GetModulate()

public Color GetModulate()

Returns

Color

GetStretchMode()

public TextureStretchMode GetStretchMode()

Returns

TextureStretchMode

GetTexture()

public Texture2D GetTexture()

Returns

Texture2D

GetTextureLayout(Vector2)

Calculates local draw placement, including source cropping for aspect-covered images.

public TextureRectLayout GetTextureLayout(Vector2 textureSize)

Parameters

textureSize Vector2

Returns

TextureRectLayout

GetTextureMinimumSize(Vector2)

Calculates the texture-derived minimum size for the current expand mode.

public Vector2 GetTextureMinimumSize(Vector2 textureSize)

Parameters

textureSize Vector2

Returns

Vector2

IsFlippedH()

public bool IsFlippedH()

Returns

bool

IsFlippedV()

public bool IsFlippedV()

Returns

bool

OnTextureChanged()

Hook for a subclass-specific texture_changed signal (only NinePatchRect has one in Godot).

protected virtual void OnTextureChanged()

SetExpandMode(TextureRectExpandMode)

public void SetExpandMode(TextureRectExpandMode mode)

Parameters

mode TextureRectExpandMode

SetFlipH(bool)

public void SetFlipH(bool enable)

Parameters

enable bool

SetFlipV(bool)

public void SetFlipV(bool enable)

Parameters

enable bool

SetModulate(Color)

public void SetModulate(Color color)

Parameters

color Color

SetStretchMode(TextureStretchMode)

public void SetStretchMode(TextureStretchMode mode)

Parameters

mode TextureStretchMode

SetTexture(Texture2D)

public void SetTexture(Texture2D texture)

Parameters

texture Texture2D