custom-classes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
custom-classes [2020/07/08 10:56] – maxime | custom-classes [2020/07/08 11:18] – maxime | ||
---|---|---|---|
Line 11: | Line 11: | ||
===== Extendable classes ===== | ===== Extendable classes ===== | ||
- | Some core types are flagged as **Extendable** in the documentation. This means an extendable type can be used as parent type when creating a custom type. In addition to new functions, you can override some base functions existing in the parent type, flagged as **virtual**. | + | Some core types are flagged as **Extendable** in the documentation. This means an extendable type can be used as parent type when creating a custom type. In addition to new functions, you can override some base functions existing in the parent type, flagged as **Virtual function**. When extend a virtual function, define a new function for your custom type with the same type and parameters. You can call the parent function using the keyword '' |
+ | |||
+ | <code lua> | ||
+ | function myCustomTypeInfo: | ||
+ | self.super: | ||
+ | ... -- custom additional behavior | ||
+ | end | ||
+ | </ | ||
---- | ---- | ||
Line 17: | Line 24: | ||
===== Custom components ===== | ===== Custom components ===== | ||
- | When you define a new component type, you can assign it properties that are editable, usable in your component' | + | For custom types extending '' |
- | + | ||
- | Components can also have functions. In addition to new functions, you can override some base functions that are automatically called for all components: | + | |
* '' | * '' | ||
* '' | * '' |
custom-classes.txt · Last modified: 2022/03/29 20:36 by minotorious