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
FlipH
public bool FlipH { get; set; }
Property Value
FlipV
public bool FlipV { get; set; }
Property Value
Modulate
public Color Modulate { get; set; }
Property Value
- Color
StretchMode
public TextureStretchMode StretchMode { get; set; }
Property Value
Texture
public Texture2D Texture { get; set; }
Property Value
- Texture2D
Methods
DrawChildControls(UIRenderContext)
protected void DrawChildControls(UIRenderContext context)
Parameters
contextUIRenderContext
GetExpandMode()
public TextureRectExpandMode GetExpandMode()
Returns
GetMinimumSize()
public override Vector2 GetMinimumSize()
Returns
- Vector2
GetModulate()
public Color GetModulate()
Returns
- Color
GetStretchMode()
public TextureStretchMode GetStretchMode()
Returns
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
textureSizeVector2
Returns
GetTextureMinimumSize(Vector2)
Calculates the texture-derived minimum size for the current expand mode.
public Vector2 GetTextureMinimumSize(Vector2 textureSize)
Parameters
textureSizeVector2
Returns
- Vector2
IsFlippedH()
public bool IsFlippedH()
Returns
IsFlippedV()
public bool IsFlippedV()
Returns
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
SetFlipH(bool)
public void SetFlipH(bool enable)
Parameters
enablebool
SetFlipV(bool)
public void SetFlipV(bool enable)
Parameters
enablebool
SetModulate(Color)
public void SetModulate(Color color)
Parameters
colorColor
SetStretchMode(TextureStretchMode)
public void SetStretchMode(TextureStretchMode mode)
Parameters
modeTextureStretchMode
SetTexture(Texture2D)
public void SetTexture(Texture2D texture)
Parameters
textureTexture2D