custom-classes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
custom-classes [2020/07/08 10:57] – [Custom components] 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 | ||
+ | </ | ||
---- | ---- |
custom-classes.txt · Last modified: 2022/03/29 20:36 by minotorious