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.
- Generating mipmaps — pass
mipmaps = truetocore.svg.createorcore.svg.create_from_rawupfront. - Survives updates —
self:updatereplaces the SVG contents but the texture is updated in place, so filter override stays applied.
Parameters
| Type | Name | Description |
|---|---|---|
core.svg.svg_filter | mode | Sampling filter to apply |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.svg.create("assets/icon.svg")
entity:set_filter(core.svg.svg_filter.NEAREST)local entity = core.svg.create("assets/icon.svg")
entity:set_filter(core.svg.svg_filter.NEAREST)
entity:set_filter(core.svg.svg_filter.DEFAULT)local entity = core.svg.create("assets/icon.svg", true)
entity:set_filter(core.svg.svg_filter.LINEAR_MIPMAP_ANISOTROPIC)