Class reference
DPITexture
Inherits Texture2D
Experimental.
An automatically scalable Texture2D based on an SVG image.
Description
An automatically scalable Texture2D based on an SVG image. DPITextures are used to automatically re-rasterize icons and other texture based UI theme elements to match viewport scale and font oversampling. See also ProjectSettings.display/window/stretch/mode ("canvas_items" mode) and Viewport.oversampling_override.
Properties
Methods
DPITexture create_from_string(String source, float scale = 1.0, float saturation = 1.0, Dictionary color_map = {}) static
Creates a new DPITexture and initializes it by allocating and setting the SVG data from string.
RID get_scaled_rid() const
Returns the RID of the texture rasterized to match the oversampling of the currently drawn canvas item.
String get_source() const
Returns SVG source code.
void set_size_override(Vector2i size)
Resizes the texture to the specified dimensions.
void set_source(String source)
Sets SVG source code.