TextureRect.xml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TextureRect" inherits="Control" category="Core" version="3.1.2">
  3. <brief_description>
  4. Control for drawing textures.
  5. </brief_description>
  6. <description>
  7. 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.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. </methods>
  13. <members>
  14. <member name="expand" type="bool" setter="set_expand" getter="has_expand">
  15. If [code]true[/code], the texture scales to fit its bounding rectangle. Default value: [code]false[/code].
  16. </member>
  17. <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureRect.StretchMode">
  18. Controls the texture's behavior when resizing the node's bounding rectangle. See [enum StretchMode].
  19. </member>
  20. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  21. The node's [Texture] resource.
  22. </member>
  23. </members>
  24. <constants>
  25. <constant name="STRETCH_SCALE_ON_EXPAND" value="0" enum="StretchMode">
  26. 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 [constant STRETCH_KEEP].
  27. </constant>
  28. <constant name="STRETCH_SCALE" value="1" enum="StretchMode">
  29. Scale to fit the node's bounding rectangle.
  30. </constant>
  31. <constant name="STRETCH_TILE" value="2" enum="StretchMode">
  32. Tile inside the node's bounding rectangle.
  33. </constant>
  34. <constant name="STRETCH_KEEP" value="3" enum="StretchMode">
  35. The texture keeps its original size and stays in the bounding rectangle's top-left corner.
  36. </constant>
  37. <constant name="STRETCH_KEEP_CENTERED" value="4" enum="StretchMode">
  38. The texture keeps its original size and stays centered in the node's bounding rectangle.
  39. </constant>
  40. <constant name="STRETCH_KEEP_ASPECT" value="5" enum="StretchMode">
  41. Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
  42. </constant>
  43. <constant name="STRETCH_KEEP_ASPECT_CENTERED" value="6" enum="StretchMode">
  44. Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio.
  45. </constant>
  46. <constant name="STRETCH_KEEP_ASPECT_COVERED" value="7" enum="StretchMode">
  47. Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.
  48. </constant>
  49. </constants>
  50. </class>