Table of Contents

TatCustomScripter.AddLibrary Method

Instantiates and registers the library class ALibraryClass in the scripter.

Remarks

AddLibrary registers the library specified by ALibraryClass in the scripter registration system. You don't need to instantiate the library, just provide the name of the library class. Scripter will automatically instantiate it and call AddLibraryInstance method to register the library. The library's Init method will be called to initiate the library. If the library class has been already registered, nothing will be done. The methods and properties of the library will be accessible through the name specified by LibraryName method declared in the library class. For example, if LibraryName returns 'MyLibrary', then methods and properties will be accessible the following way.

MyLibrary.MyMethod;

If ADefault parameter is true, you have the option to omit library name and call the method directly from script.

MyMethod;

Example of use. atScripter1.AddLibrary(TatButtonsLibrary);

Syntax

Unit: atScript

function TatCustomScripter.AddLibrary(ALibraryClass: TatScripterLibraryClass; ADefault: Boolean = True): TatScripterLibrary;

Parameters

<-> Parameter Type Description
ALibraryClass TatScripterLibrary​Class
ADefault Boolean Optional: Default value is True

See also