AtlasTexture.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AtlasTexture" inherits="Texture" version="3.4">
  3. <brief_description>
  4. Crops out one part of a texture, such as a texture from a texture atlas.
  5. </brief_description>
  6. <description>
  7. [Texture] resource that crops out one part of the [member atlas] texture, defined by [member 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 [Texture] for the [member atlas], a [member region] that defines the area of [member atlas] to use, and a [member margin] that defines the border width.
  8. [AtlasTexture] cannot be used in an [AnimatedTexture], cannot be tiled in nodes such as [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.
  9. [b]Note:[/b] AtlasTextures don't support repetition. The [constant Texture.FLAG_REPEAT] and [constant Texture.FLAG_MIRRORED_REPEAT] flags are ignored when using an AtlasTexture.
  10. </description>
  11. <tutorials>
  12. </tutorials>
  13. <methods>
  14. </methods>
  15. <members>
  16. <member name="atlas" type="Texture" setter="set_atlas" getter="get_atlas">
  17. The texture that contains the atlas. Can be any [Texture] subtype.
  18. </member>
  19. <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip" default="false">
  20. If [code]true[/code], clips the area outside of the region to avoid bleeding of the surrounding texture pixels.
  21. </member>
  22. <member name="flags" type="int" setter="set_flags" getter="get_flags" override="true" default="0" />
  23. <member name="margin" type="Rect2" setter="set_margin" getter="get_margin" default="Rect2( 0, 0, 0, 0 )">
  24. The margin around the region. The [Rect2]'s [member Rect2.size] parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin.
  25. </member>
  26. <member name="region" type="Rect2" setter="set_region" getter="get_region" default="Rect2( 0, 0, 0, 0 )">
  27. The AtlasTexture's used region.
  28. </member>
  29. </members>
  30. <constants>
  31. </constants>
  32. </class>