Table of Contents

Class TextureRect

A control that displays a texture.

Inheritance
TextureRect

Remarks

A control that displays a texture, for example an icon inside a GUI. The texture's placement can be controlled with the stretch_mode property. It can scale, tile, or stay centered inside its bounding rectangle.

See Also

Properties

expand_mode

Defines how minimum size is determined based on the texture's size. See ExpandMode for options.

var expand_mode : int = 0

Property Value

int

Remarks

  • void set_expand_mode(int value)
  • int get_expand_mode

flip_h

If true, texture is flipped horizontally.

var flip_h : bool = false

Property Value

bool

Remarks

  • void set_flip_h(bool value)
  • bool is_flipped_h

flip_v

If true, texture is flipped vertically.

var flip_v : bool = false

Property Value

bool

Remarks

  • void set_flip_v(bool value)
  • bool is_flipped_v

stretch_mode

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

var stretch_mode : int = 0

Property Value

int

Remarks

  • void set_stretch_mode(int value)
  • int get_stretch_mode

texture

The node's Texture2D resource.

var texture : Texture2D

Property Value

Texture2D

Remarks