2025-04-14 11:27:02 +03:00
<?xml version="1.0" encoding="UTF-8" ?>
2025-08-20 20:46:38 +03:00
<class name= "DPITexture" inherits= "Texture2D" experimental= "" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2025-04-14 11:27:02 +03:00
<brief_description >
2025-08-20 20:46:38 +03:00
An automatically scalable [Texture2D] based on an SVG image.
2025-04-14 11:27:02 +03:00
</brief_description>
<description >
2025-08-20 20:46:38 +03:00
An automatically scalable [Texture2D] based on an SVG image. [DPITexture]s are used to automatically re-rasterize icons and other texture based UI theme elements to match viewport scale and font oversampling. See also [member ProjectSettings.display/window/stretch/mode] ("canvas_items" mode) and [member Viewport.oversampling_override].
2025-04-14 11:27:02 +03:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "create_from_string" qualifiers= "static" >
2025-08-20 20:46:38 +03:00
<return type= "DPITexture" />
2025-04-14 11:27:02 +03:00
<param index= "0" name= "source" type= "String" />
<param index= "1" name= "scale" type= "float" default= "1.0" />
<param index= "2" name= "saturation" type= "float" default= "1.0" />
<param index= "3" name= "color_map" type= "Dictionary" default= "{}" />
<description >
2025-08-20 20:46:38 +03:00
Creates a new [DPITexture] and initializes it by allocating and setting the SVG data from string.
2025-04-14 11:27:02 +03:00
</description>
</method>
2025-07-30 12:43:49 +03:00
<method name= "get_scaled_rid" qualifiers= "const" >
<return type= "RID" />
<description >
Returns the [RID] of the texture rasterized to match the oversampling of the currently drawn canvas item.
</description>
</method>
2025-04-22 18:42:59 +03:00
<method name= "get_source" qualifiers= "const" >
<return type= "String" />
<description >
Returns SVG source code.
</description>
</method>
2025-04-14 11:27:02 +03:00
<method name= "set_size_override" >
<return type= "void" />
<param index= "0" name= "size" type= "Vector2i" />
<description >
Resizes the texture to the specified dimensions.
</description>
</method>
2025-04-22 18:42:59 +03:00
<method name= "set_source" >
<return type= "void" />
<param index= "0" name= "source" type= "String" />
<description >
Sets SVG source code.
</description>
</method>
2025-04-14 11:27:02 +03:00
</methods>
<members >
<member name= "base_scale" type= "float" setter= "set_base_scale" getter= "get_base_scale" default= "1.0" >
2025-08-20 20:46:38 +03:00
Texture scale. [code]1.0[/code] is the original SVG size. Higher values result in a larger image.
2025-04-14 11:27:02 +03:00
</member>
<member name= "color_map" type= "Dictionary" setter= "set_color_map" getter= "get_color_map" default= "{}" >
2025-08-20 20:46:38 +03:00
If set, remaps texture colors according to [Color]-[Color] map.
2025-04-14 11:27:02 +03:00
</member>
<member name= "resource_local_to_scene" type= "bool" setter= "set_local_to_scene" getter= "is_local_to_scene" overrides= "Resource" default= "false" />
<member name= "saturation" type= "float" setter= "set_saturation" getter= "get_saturation" default= "1.0" >
Overrides texture saturation.
</member>
</members>
</class>