A control that displays a texture.
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.
EXPAND_KEEP_SIZE = 0The minimum size will be equal to texture size, i.e. TextureRect can't be smaller than the texture.
EXPAND_IGNORE_SIZE = 1The size of the texture won't be considered for minimum size calculation, so the TextureRect can be shrunk down past the texture size.
EXPAND_FIT_WIDTH = 2The height of the texture will be ignored. Minimum width will be equal to the current height. Useful for horizontal layouts, e.g. inside HBoxContainer.
EXPAND_FIT_WIDTH_PROPORTIONAL = 3Same as EXPAND_FIT_WIDTH, but keeps texture's aspect ratio.
EXPAND_FIT_HEIGHT = 4The width of the texture will be ignored. Minimum height will be equal to the current width. Useful for vertical layouts, e.g. inside VBoxContainer.
EXPAND_FIT_HEIGHT_PROPORTIONAL = 5Same as EXPAND_FIT_HEIGHT, but keeps texture's aspect ratio.
STRETCH_SCALE = 0Scale to fit the node's bounding rectangle.
STRETCH_TILE = 1Tile inside the node's bounding rectangle.
Note: STRETCH_TILE mode is not supported for texture set to an AtlasTexture with non-zero AtlasTexture.margin.
STRETCH_KEEP = 2The texture keeps its original size and stays in the bounding rectangle's top-left corner.
STRETCH_KEEP_CENTERED = 3The texture keeps its original size and stays centered in the node's bounding rectangle.
STRETCH_KEEP_ASPECT = 4Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
STRETCH_KEEP_ASPECT_CENTERED = 5Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio.
STRETCH_KEEP_ASPECT_COVERED = 6Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.