self:set_filter

Client

Sets the sampling filter of the SVG


Syntax

local status = self:set_filter(
    mode
)

Mipmap-based filters require the texture to already have a svg chain — no chain is generated on demand.
NEAREST_MIPMAP, LINEAR_MIPMAP, and their ANISOTROPIC variants throw if the SVG was created without mipmaps.

Parameters

TypeNameDescription
core.svg.svg_filtermodeSampling filter to apply

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Force crisp nearest-neighbour sampling
local entity = core.svg.create("assets/icon.svg")

entity:set_filter(core.svg.svg_filter.NEAREST)
Reset back to the inherited default filter
local entity = core.svg.create("assets/icon.svg")

entity:set_filter(core.svg.svg_filter.NEAREST)
entity:set_filter(core.svg.svg_filter.DEFAULT)
Apply a mipmap filter — SVG must be created with mipmaps
local entity = core.svg.create("assets/icon.svg", true)

entity:set_filter(core.svg.svg_filter.LINEAR_MIPMAP_ANISOTROPIC)

On this page