Skip to content
0.2.0-dev Download ZIP
29 lines ·2.3 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="AtlasTexture" inherits="Texture2D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A texture that crops out part of another Texture2D.
5 </brief_description>
6 <description>
7 [Texture2D] resource that draws only part of its [member atlas] texture, as defined by the [member region]. An additional [member margin] can also be set, which is useful for small adjustments.
8 Multiple [AtlasTexture] resources can be cropped from the same [member atlas]. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls.
9 [b]Note:[/b] [AtlasTexture] cannot be used in an [AnimatedTexture], and will not tile properly in nodes such as [TextureRect] or [Sprite2D]. To tile an [AtlasTexture], modify its [member region] instead.
10 </description>
11 <tutorials>
12 </tutorials>
13 <members>
14 <member name="atlas" type="Texture2D" setter="set_atlas" getter="get_atlas">
15 The texture that contains the atlas. Can be any type inheriting from [Texture2D], including another [AtlasTexture].
16 </member>
17 <member name="filter_clip" type="bool" setter="set_filter_clip" getter="has_filter_clip" default="false">
18 If [code]true[/code], the area outside of the [member region] is clipped to avoid bleeding of the surrounding texture pixels.
19 </member>
20 <member name="margin" type="Rect2" setter="set_margin" getter="get_margin" default="Rect2(0, 0, 0, 0)">
21 The margin around the [member region]. Useful for small adjustments. If the [member Rect2.size] of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the margin.
22 </member>
23 <member name="region" type="Rect2" setter="set_region" getter="get_region" default="Rect2(0, 0, 0, 0)">
24 The region used to draw the [member atlas]. If either dimension of the region's size is [code]0[/code], the value from [member atlas] size will be used for that axis instead.
25 [b]Note:[/b] The image size is always an integer, so the actual region size is rounded down.
26 </member>
27 <member name="resource_local_to_scene" type="bool" setter="set_local_to_scene" getter="is_local_to_scene" overrides="Resource" default="false" />
28 </members>
29</class>