0.2.0-dev Download ZIP
29 lines ·2.5 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="ResourceImporterTextureAtlas" inherits="ResourceImporter" api_type="editor" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Imports a collection of textures from a PNG image into an optimized [AtlasTexture] for 2D rendering. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This imports a collection of textures from a PNG image into an [AtlasTexture] or 2D [ArrayMesh]. This can be used to save memory when importing 2D animations from spritesheets. Texture atlases are only supported in 2D rendering, not 3D. See also [ResourceImporterTexture] and [ResourceImporterLayeredTexture]. |
| 8 | [b]Note:[/b] [ResourceImporterTextureAtlas] does not handle importing [TileSetAtlasSource], which is created using the [TileSet] editor instead. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | </tutorials> |
| 12 | <members> |
| 13 | <member name="atlas_file" type="String" setter="" getter="" default=""""> |
| 14 | Path to the atlas spritesheet. This [i]must[/i] be set to valid path to a PNG image. Otherwise, the atlas will fail to import. |
| 15 | </member> |
| 16 | <member name="crop_to_region" type="bool" setter="" getter="" default="false"> |
| 17 | If [code]true[/code], discards empty areas from the atlas. This only affects final sprite positioning, not storage. See also [member trim_alpha_border_from_region]. |
| 18 | [b]Note:[/b] Only effective if [member import_mode] is [b]Region[/b]. |
| 19 | </member> |
| 20 | <member name="import_mode" type="int" setter="" getter="" default="0"> |
| 21 | [b]Region:[/b] Imports the atlas in an [AtlasTexture] resource, which is rendered as a rectangle. This is fast to render, but transparent areas still have to be rendered if they can't be trimmed effectively by [member trim_alpha_border_from_region]. This can reduce performance when rendering large sprites on screen. |
| 22 | [b]Mesh:[/b] Imports the atlas as an [ArrayMesh] resource, keeping the original bitmap visible (but rendered as a polygon). This can be used to reduce fill rate when rendering large transparent sprites, at the cost of slower rendering if there are little to no transparent areas in the sprite. |
| 23 | </member> |
| 24 | <member name="trim_alpha_border_from_region" type="bool" setter="" getter="" default="true"> |
| 25 | If [code]true[/code], trims the region to exclude fully transparent pixels using a clipping rectangle (which is never rotated). This can be used to save memory. See also [member crop_to_region]. |
| 26 | [b]Note:[/b] Only effective if [member import_mode] is [b]Region[/b]. |
| 27 | </member> |
| 28 | </members> |
| 29 | </class> |