class_atlastexture.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. Crops out one part of a texture, such as a texture from a texture atlas.
  11. Description
  12. -----------
  13. :ref:`Texture2D<class_Texture2D>` resource that crops out one part of the :ref:`atlas<class_AtlasTexture_property_atlas>` texture, defined by :ref:`region<class_AtlasTexture_property_region>`. The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a :ref:`Texture2D<class_Texture2D>` for the :ref:`atlas<class_AtlasTexture_property_atlas>`, a :ref:`region<class_AtlasTexture_property_region>` that defines the area of :ref:`atlas<class_AtlasTexture_property_atlas>` to use, and a :ref:`margin<class_AtlasTexture_property_margin>` that defines the border width.
  14. \ ``AtlasTexture`` cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, cannot be tiled in nodes such as :ref:`TextureRect<class_TextureRect>`, and does not work properly if used inside of other ``AtlasTexture`` resources. Multiple ``AtlasTexture`` resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files.
  15. Properties
  16. ----------
  17. +-----------------------------------+-------------------------------------------------------------+-----------------------+
  18. | :ref:`Texture2D<class_Texture2D>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
  19. +-----------------------------------+-------------------------------------------------------------+-----------------------+
  20. | :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
  21. +-----------------------------------+-------------------------------------------------------------+-----------------------+
  22. | :ref:`Rect2<class_Rect2>` | :ref:`margin<class_AtlasTexture_property_margin>` | ``Rect2(0, 0, 0, 0)`` |
  23. +-----------------------------------+-------------------------------------------------------------+-----------------------+
  24. | :ref:`Rect2<class_Rect2>` | :ref:`region<class_AtlasTexture_property_region>` | ``Rect2(0, 0, 0, 0)`` |
  25. +-----------------------------------+-------------------------------------------------------------+-----------------------+
  26. Property Descriptions
  27. ---------------------
  28. .. _class_AtlasTexture_property_atlas:
  29. - :ref:`Texture2D<class_Texture2D>` **atlas**
  30. +----------+------------------+
  31. | *Setter* | set_atlas(value) |
  32. +----------+------------------+
  33. | *Getter* | get_atlas() |
  34. +----------+------------------+
  35. The texture that contains the atlas. Can be any :ref:`Texture2D<class_Texture2D>` subtype.
  36. ----
  37. .. _class_AtlasTexture_property_filter_clip:
  38. - :ref:`bool<class_bool>` **filter_clip**
  39. +-----------+------------------------+
  40. | *Default* | ``false`` |
  41. +-----------+------------------------+
  42. | *Setter* | set_filter_clip(value) |
  43. +-----------+------------------------+
  44. | *Getter* | has_filter_clip() |
  45. +-----------+------------------------+
  46. If ``true``, clips the area outside of the region to avoid bleeding of the surrounding texture pixels.
  47. ----
  48. .. _class_AtlasTexture_property_margin:
  49. - :ref:`Rect2<class_Rect2>` **margin**
  50. +-----------+-----------------------+
  51. | *Default* | ``Rect2(0, 0, 0, 0)`` |
  52. +-----------+-----------------------+
  53. | *Setter* | set_margin(value) |
  54. +-----------+-----------------------+
  55. | *Getter* | get_margin() |
  56. +-----------+-----------------------+
  57. The margin around the region. The :ref:`Rect2<class_Rect2>`'s :ref:`Rect2.size<class_Rect2_property_size>` parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin.
  58. ----
  59. .. _class_AtlasTexture_property_region:
  60. - :ref:`Rect2<class_Rect2>` **region**
  61. +-----------+-----------------------+
  62. | *Default* | ``Rect2(0, 0, 0, 0)`` |
  63. +-----------+-----------------------+
  64. | *Setter* | set_region(value) |
  65. +-----------+-----------------------+
  66. | *Getter* | get_region() |
  67. +-----------+-----------------------+
  68. The AtlasTexture's used region.
  69. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  70. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  71. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  72. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  73. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  74. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`