User Tools

Site Tools


custom-classes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
custom-classes [2020/07/08 10:56] maximecustom-classes [2020/07/08 10:57] – [Custom components] maxime
Line 6: Line 6:
  
 You can find more information on on the ''registerClass'' function on the [[mod-management-functions#registerClass|mod management functions page]]. You can find more information on on the ''registerClass'' function on the [[mod-management-functions#registerClass|mod management functions page]].
 +
 +----
  
 ===== Extendable classes ===== ===== Extendable classes =====
Line 15: Line 17:
 ===== Custom components ===== ===== Custom components =====
  
-When you define a new component type, you can assign it properties that are editable, usable in your component's behavior, and that can be saved in a savegame. Those properties must have a name and a type. They can also have a default value, flags, and access functions (getter and setter). +For custom types extending ''[[api:component|COMPONENT]]'', you can override some base functions that are automatically called for all components:
- +
-Components can also have functions. In addition to new functions, you can override some base functions that are automatically called for all components:+
   * ''**create**()'': when the component is created   * ''**create**()'': when the component is created
   * ''**init**()'': when the component is initialized in the game   * ''**init**()'': when the component is initialized in the game
custom-classes.txt · Last modified: 2022/03/29 20:36 by minotorious

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki