Skip to main content

requireType

Function

Load a script by name or path in order to use that type to create or get a component at runtime.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

requireType(name): string

Load a script by name or path in order to use that type to create or get a component at runtime.

You can use the modules name or path. Both “by name” or “by path” will be relative to the script which is calling require, but by name will check the same folder as the script, then the parent folder, and so on. In addition, any require can be relative to your library folder. Take a look at the Scripting guide to learn more.

Parameters

ParameterType
namestring

Returns

string