class_atlastexture.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AtlasTexture.xml.
  6. .. _class_AtlasTexture:
  7. AtlasTexture
  8. ============
  9. **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A texture that crops out part of another Texture2D.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. :ref:`Texture2D<class_Texture2D>` resource that draws only part of its :ref:`atlas<class_AtlasTexture_property_atlas>` texture, as defined by the :ref:`region<class_AtlasTexture_property_region>`. An additional :ref:`margin<class_AtlasTexture_property_margin>` can also be set, which is useful for small adjustments.
  15. Multiple **AtlasTexture** resources can be cropped from the same :ref:`atlas<class_AtlasTexture_property_atlas>`. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls.
  16. \ **Note:** **AtlasTexture** cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, and will not tile properly in nodes such as :ref:`TextureRect<class_TextureRect>` or :ref:`Sprite2D<class_Sprite2D>`. To tile an **AtlasTexture**, modify its :ref:`region<class_AtlasTexture_property_region>` instead.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
  23. | :ref:`Texture2D<class_Texture2D>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
  24. +-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
  26. +-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
  27. | :ref:`Rect2<class_Rect2>` | :ref:`margin<class_AtlasTexture_property_margin>` | ``Rect2(0, 0, 0, 0)`` |
  28. +-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
  29. | :ref:`Rect2<class_Rect2>` | :ref:`region<class_AtlasTexture_property_region>` | ``Rect2(0, 0, 0, 0)`` |
  30. +-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  32. +-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Property Descriptions
  37. ---------------------
  38. .. _class_AtlasTexture_property_atlas:
  39. .. rst-class:: classref-property
  40. :ref:`Texture2D<class_Texture2D>` **atlas** :ref:`🔗<class_AtlasTexture_property_atlas>`
  41. .. rst-class:: classref-property-setget
  42. - |void| **set_atlas**\ (\ value\: :ref:`Texture2D<class_Texture2D>`\ )
  43. - :ref:`Texture2D<class_Texture2D>` **get_atlas**\ (\ )
  44. The texture that contains the atlas. Can be any type inheriting from :ref:`Texture2D<class_Texture2D>`, including another **AtlasTexture**.
  45. .. rst-class:: classref-item-separator
  46. ----
  47. .. _class_AtlasTexture_property_filter_clip:
  48. .. rst-class:: classref-property
  49. :ref:`bool<class_bool>` **filter_clip** = ``false`` :ref:`🔗<class_AtlasTexture_property_filter_clip>`
  50. .. rst-class:: classref-property-setget
  51. - |void| **set_filter_clip**\ (\ value\: :ref:`bool<class_bool>`\ )
  52. - :ref:`bool<class_bool>` **has_filter_clip**\ (\ )
  53. If ``true``, the area outside of the :ref:`region<class_AtlasTexture_property_region>` is clipped to avoid bleeding of the surrounding texture pixels.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_AtlasTexture_property_margin:
  57. .. rst-class:: classref-property
  58. :ref:`Rect2<class_Rect2>` **margin** = ``Rect2(0, 0, 0, 0)`` :ref:`🔗<class_AtlasTexture_property_margin>`
  59. .. rst-class:: classref-property-setget
  60. - |void| **set_margin**\ (\ value\: :ref:`Rect2<class_Rect2>`\ )
  61. - :ref:`Rect2<class_Rect2>` **get_margin**\ (\ )
  62. The margin around the :ref:`region<class_AtlasTexture_property_region>`. Useful for small adjustments. If the :ref:`Rect2.size<class_Rect2_property_size>` of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the margin.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_AtlasTexture_property_region:
  66. .. rst-class:: classref-property
  67. :ref:`Rect2<class_Rect2>` **region** = ``Rect2(0, 0, 0, 0)`` :ref:`🔗<class_AtlasTexture_property_region>`
  68. .. rst-class:: classref-property-setget
  69. - |void| **set_region**\ (\ value\: :ref:`Rect2<class_Rect2>`\ )
  70. - :ref:`Rect2<class_Rect2>` **get_region**\ (\ )
  71. The region used to draw the :ref:`atlas<class_AtlasTexture_property_atlas>`. If either dimension of the region's size is ``0``, the value from :ref:`atlas<class_AtlasTexture_property_atlas>` size will be used for that axis instead.
  72. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  73. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  74. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  75. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  76. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  77. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  78. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  79. .. |void| replace:: :abbr:`void (No return value.)`