DPITexture
Experimental: This class may be changed or removed in future versions.
Inherits:Texture2D<Texture<Resource<RefCounted<Object
An automatically scalableTexture2D based on an SVG image.
Description
An automatically scalableTexture2D 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 alsoProjectSettings.display/window/stretch/mode ("canvas_items" mode) andViewport.oversampling_override.
Properties
| ||
| ||
resource_local_to_scene |
| |
|
Methods
create_from_string(source:String, scale:float = 1.0, saturation:float = 1.0, color_map:Dictionary = {})static | |
set_size_override(size:Vector2i) | |
set_source(source:String) |
Property Descriptions
floatget_base_scale()
Texture scale.1.0 is the original SVG size. Higher values result in a larger image.
Dictionarycolor_map ={}🔗
Dictionaryget_color_map()
If set, remaps texture colors according toColor-Color map.
floatget_saturation()
Overrides texture saturation.
Method Descriptions
DPITexturecreate_from_string(source:String, scale:float = 1.0, saturation:float = 1.0, color_map:Dictionary = {})static🔗
Creates a newDPITexture and initializes it by allocating and setting the SVG data from string.
Returns theRID of the texture rasterized to match the oversampling of the currently drawn canvas item.
Returns SVG source code.
voidset_size_override(size:Vector2i)🔗
Resizes the texture to the specified dimensions.
voidset_source(source:String)🔗
Sets SVG source code.