DPITexture
实验性: This class may be changed or removed in future versions.
继承: Texture2D < Texture < Resource < RefCounted < Object
可自动缩放的 Texture2D,基于 SVG 图像。
描述
可自动缩放的 Texture2D,基于 SVG 图像。DPITexture 可以对图标及其他基于纹理的 UI 主题元素自动重新进行栅格化,从而匹配视口的缩放和字体过采样设置。另见 ProjectSettings.display/window/stretch/mode(“canvas_items”模式)和 Viewport.oversampling_override。
属性
|
||
|
||
resource_local_to_scene |
|
|
|
方法
create_from_string(source: String, scale: float = 1.0, saturation: float = 1.0, color_map: Dictionary = {}) static |
|
get_scaled_rid() const |
|
get_source() const |
|
void |
set_size_override(size: Vector2i) |
void |
set_source(source: String) |
属性说明
纹理缩放。1.0 是原始 SVG 大小。值越大得到的图像越大。
Dictionary color_map = {} 🔗
void set_color_map(value: Dictionary)
Dictionary get_color_map()
设置后,会根据 Color-Color 映射对纹理中的颜色进行重映射。
覆盖纹理饱和度。
方法说明
DPITexture create_from_string(source: String, scale: float = 1.0, saturation: float = 1.0, color_map: Dictionary = {}) static 🔗
Creates a new DPITexture and initializes it by allocating and setting the SVG data to source.
返回栅格化后的纹理 RID,与当前绘制的画布项的过采样匹配。
Returns this SVG texture's source code.
void set_size_override(size: Vector2i) 🔗
将纹理的大小调整为指定的尺寸。
void set_source(source: String) 🔗
Sets this SVG texture's source code.