Vital.sandbox
Texture

self:is_type

Client

Checks whether the instance belongs to the specified type


Syntax

local result = self:is_type(name)

Parameters

TypeNameDescription
stringnameType to check against

Returns

TypeNameDescription
boolresulttrue if the instance matches the given type, false otherwise

Examples

Check the type of a texture instance
local tex = texture.create("assets/sprite.png")

engine.print("info", tex:is_type("texture")) --true
engine.print("info", tex:is_type("svg")) --false

On this page