Vital.sandbox
SVG

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 an SVG instance
local icon = svg.create("assets/icon.svg")

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

On this page