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

float base_scale = 1.0

Texture scale. 1.0 is the original SVG size. Higher values result in a larger image.

bool resource_local_to_scene = false

float saturation = 1.0

Overrides texture saturation.

Methods

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.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.