godot/doc/classes/TextureRect.xml

59 lines
3.0 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" ?>
2019-04-01 10:33:56 +00:00
<class name="TextureRect" inherits="Control" category="Core" version="3.2">
<brief_description>
2018-05-20 20:43:48 +00:00
Control for drawing textures.
</brief_description>
<description>
2018-05-20 20:43:48 +00:00
Used to draw icons and sprites in a user interface. The texture's placement can be controlled with the [member stretch_mode] property. It can scale, tile, or stay centered inside its bounding rectangle.
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
</methods>
<members>
<member name="expand" type="bool" setter="set_expand" getter="has_expand">
If [code]true[/code], the texture scales to fit its bounding rectangle. Default value: [code]false[/code].
</member>
<member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureRect.StretchMode">
2018-05-20 20:43:48 +00:00
Controls the texture's behavior when resizing the node's bounding rectangle. See [enum StretchMode].
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
The node's [Texture] resource.
</member>
<member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h">
If [code]true[/code], texture is flipped horizontally. Default value: [code]false[/code].
</member>
<member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v">
If [code]true[/code], texture is flipped vertically. Default value: [code]false[/code].
</member>
</members>
<constants>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_SCALE_ON_EXPAND" value="0" enum="StretchMode">
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].
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_SCALE" value="1" enum="StretchMode">
Scale to fit the node's bounding rectangle.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_TILE" value="2" enum="StretchMode">
Tile inside the node's bounding rectangle.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_KEEP" value="3" enum="StretchMode">
The texture keeps its original size and stays in the bounding rectangle's top-left corner.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_KEEP_CENTERED" value="4" enum="StretchMode">
The texture keeps its original size and stays centered in the node's bounding rectangle.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_KEEP_ASPECT" value="5" enum="StretchMode">
Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_KEEP_ASPECT_CENTERED" value="6" enum="StretchMode">
Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="STRETCH_KEEP_ASPECT_COVERED" value="7" enum="StretchMode">
Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.
</constant>
</constants>
</class>