core.svg.create
Client
Creates a new SVG instance from a file path
Syntax
local instance = core.svg.create(
path,
mipmaps = false
)Only needed if you already know a mipmap-based filter is coming.
- Use it when — the SVG is going to use
NEAREST_MIPMAP,LINEAR_MIPMAP, or anANISOTROPICvariant. - Before compressing — if both mipmaps and compression are needed, pass
truehere;self:compresscannot generate mipmaps, so this is the only opportunity.
Parameters
| Type | Name | Description |
|---|---|---|
string | path | File path to the SVG asset |
bool | mipmaps | Determines whether to generate a mipmap chain for the underlying svg texture |
Returns
| Type | Name | Description |
|---|---|---|
svg | instance | Created SVG instance |
Examples
local entity = core.svg.create("assets/icon.svg")local entity = core.svg.create("assets/icon.svg", true)
entity:set_filter(core.svg.svg_filter.LINEAR_MIPMAP_ANISOTROPIC)