self:get_filter

Client

Retrieves the current sampling filter of the texture


Syntax

local mode = self:get_filter()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
core.texture.texture_filtermodeSampling filter of the texture

Examples

Check a texture's filter before overriding it
local entity = core.texture.create("assets/sprite.png")

if entity:get_filter() == core.texture.texture_filter.DEFAULT then
    entity:set_filter(core.texture.texture_filter.NEAREST)
end
Copy one texture's filter onto another
local source = core.texture.create("assets/tiles/grass0.png")
source:set_filter(core.texture.texture_filter.NEAREST)

local target = core.texture.create("assets/tiles/stone0.png")
target:set_filter(source:get_filter())

On this page