|Top Previous Next|
This namespace holds the unified class implementation for Girder. It is suggested you follow this class structure when building your own scripts.
The basic structure of a new class is as follows
If you want to subclass this new class simply require it on the first line and assign it to the base variable. Any public variables or functions will be part of the public interface of the class. Any local functions or variables will be private.
If we saved this class under the name "example/test.lua" we could use the following code to instantiate the class:
As you can see param1 and param2 will be passed to the init function of our class. You can have as many of these as you like. Also note that the class names are capitalized and the variable names start with a small letter. This helps keep the Class vs. instantiated objects clear.