Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
AtlasTexture¶
继承: Texture2D < Texture < Resource < RefCounted < Object
裁剪其他 Texture2D 的纹理。
描述¶
Texture2D 资源,只绘制其 atlas 纹理中的由 region 所定义的那部分。还可以设置一个额外的 margin,这对于小的调整很有用。
可以从同一个atlas中裁剪出多个 AtlasTexture 资源。将许多较小的纹理打包成一个单一的大纹理有助于优化视频内存成本和渲染调用。
注意:AtlasTexture 不能在 AnimatedTexture 中使用,并且当在其他 AtlasTexture 资源内时,可能无法在 TextureRect 等节点中正确平铺。
属性¶
|
||
|
||
|
||
resource_local_to_scene |
|
属性说明¶
Texture2D atlas
包含该图集的纹理。可以是任何继承自 Texture2D 的类型,包括其他 AtlasTexture。
bool filter_clip = false
如果为 true
,则 region 之外的区域将被裁剪以避免周围纹理像素的渗色。
Rect2 margin = Rect2(0, 0, 0, 0)
围绕 region 的边距。对小的调整很有用。如果设置了该属性(编辑器中的“w”和“h”)的 Rect2.size,则绘制的纹理将被调整大小以适合该边距。
Rect2 region = Rect2(0, 0, 0, 0)
用于绘制 atlas 的区域。