Skip to content

Commit 61a1e5e

Browse files
Mentions the script nodes in the user component base class.
1 parent a8c2075 commit 61a1e5e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scene-editor/user-components-super-class.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ In the previous section, we explored how you can implement behaviors by listenin
77

88
The components concept provided by |PhaserEditor|_ is flexible. However, we think it is a good idea to propose a way of implementing the components.
99

10-
For this reason, we created a **UserComponent** class that you can use as the base class for all your components.
10+
For this reason, we created a **UserComponent** class that you can use as the base class for all your components. This class is included in the `phasereditor2d-scripts-core <https://github.com/PhaserEditor2D/phasereditor2d-scripts-core>`_ library and should be included in your project if you created it with a |PhaserEditor|_ project template.
1111

12-
Following the philosophy or |PhaserEditor|_, the code of the **UserComponent** class is generated by the editor. You have the option of telling the editor to generate the **UserComponent** class and it will create a file and "write the code for you".
12+
`Learn more about script libraries <./script-node-libraries.html>`_
13+
14+
If you are not using script libraries, you have the option of telling the editor to generate the **UserComponent** class and it will create a file and "write the code for you".
1315

1416
The procedure is simple, just open the context menu of the User Components Editor. In the **Resources** menu, there are options for creating the ``UserComponent.js`` files in different formats:
1517

1618
.. image:: ../images/scene-editor-user-components-create-base-class-file-04012021.webp
17-
:alt: Context meno for creating the UserComponent.js file.
19+
:alt: Context menu for creating the UserComponent.js file.
1820

1921
The options are:
2022

@@ -51,7 +53,7 @@ In the `Implementing behaviors with the Phaser events <./user-components-start-u
5153
destroy() { }
5254
}
5355
54-
It register the event listeners in the constructor:
56+
It registers the event listeners in the constructor:
5557

5658
.. code::
5759

0 commit comments

Comments
 (0)