self:is_compressed

Client

Checks whether the texture has been GPU block-compressed


Syntax

local result = self:is_compressed()

Parameters

No parameters are accepted by this function

Returns

TypeNameDescription
boolresulttrue if the texture is GPU block-compressed, false otherwise

Examples

Check compression state before compressing
local entity = core.texture.create("assets/diffuse.png")

if not entity:is_compressed() then
    entity:compress(core.texture.compression_mode.S3TC)
end
Guard a convert call against compressed textures
local entity = core.texture.create("assets/sprite.png")

if not entity:is_compressed() then
    entity:convert(core.texture.texel_format.RGBA8)
end

On this page