2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2018-02-27 12:40:43 +00:00
<class name= "TextureRect" inherits= "Control" category= "Core" version= "3.1" >
2017-09-12 20:42:36 +00:00
<brief_description >
2017-09-16 09:54:44 +00:00
Draws a sprite or a texture inside a User Interface. The texture can tile or not.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2017-09-16 09:54:44 +00:00
Use TextureRect to draw icons and sprites in your User Interfaces. To create panels and menu boxes, take a look at [NinePatchFrame]. Its Stretch Mode property controls the texture's scale and placement. It can scale, tile and stay centered inside its bounding rectangle. TextureRect is one of the 5 most common nodes to create game UI.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
</methods>
<members >
2017-09-13 06:49:40 +00:00
<member name= "expand" type= "bool" setter= "set_expand" getter= "has_expand" >
2017-09-16 09:54:44 +00:00
If [code]true[/code], the texture scales to fit its bounding rectangle. Default value: [code]false[/code].
2017-09-12 20:42:36 +00:00
</member>
2017-09-13 06:49:40 +00:00
<member name= "stretch_mode" type= "int" setter= "set_stretch_mode" getter= "get_stretch_mode" enum= "TextureRect.StretchMode" >
2017-09-16 09:54:44 +00:00
Controls the texture's behavior when you resize the node's bounding rectangle. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more.
2017-09-12 20:42:36 +00:00
</member>
2017-09-13 06:49:40 +00:00
<member name= "texture" type= "Texture" setter= "set_texture" getter= "get_texture" >
2017-09-16 09:54:44 +00:00
The node's [Texture] resource.
2017-09-12 20:42:36 +00:00
</member>
</members>
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_SCALE_ON_EXPAND" value= "0" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
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 [code]STRETCH_KEEP[/code].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_SCALE" value= "1" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
Scale to fit the node's bounding rectangle.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_TILE" value= "2" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
Tile inside the node's bounding rectangle.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_KEEP" value= "3" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
The texture keeps its original size and stays in the bounding rectangle's top-left corner.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_KEEP_CENTERED" value= "4" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
The texture keeps its original size and stays centered in the node's bounding rectangle.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_KEEP_ASPECT" value= "5" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_KEEP_ASPECT_CENTERED" value= "6" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STRETCH_KEEP_ASPECT_COVERED" value= "7" enum= "StretchMode" >
2017-09-16 09:54:44 +00:00
Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.
2017-09-12 20:42:36 +00:00
</constant>
</constants>
</class>