Merge class_name docs from scripting_continued.rst into gdscript docs

This commit is contained in:
Nathan Lovato
2020-11-07 23:23:19 -06:00
parent 47b0008cc0
commit 5a21563707
7 changed files with 12 additions and 51 deletions

View File

@@ -1047,8 +1047,6 @@ There are 6 pattern types:
"Sword", "Splash potion", "Fist":
print("Yep, you've taken damage")
Classes
~~~~~~~
@@ -1065,6 +1063,11 @@ path. For example, if you name a script file ``character.gd``::
var Character = load("res://path/to/character.gd")
var character_node = Character.new()
.. _doc_gdscript_basics_class_name:
Registering named classes
~~~~~~~~~~~~~~~~~~~~~~~~~
Instead, you can give your class a name to register it as a new type in Godot's
editor. For that, you use the ``class_name`` keyword. You can add an
optional comma followed by a path to an image, to use it as an icon. Your class

View File

@@ -107,7 +107,7 @@ Currently you can use three types of… types:
1. :ref:`Built-in <doc_gdscript_builtin_types>`
2. Core classes and nodes (``Object``, ``Node``, ``Area2D``,
``Camera2D``, etc.)
3. Your own, custom classes. Look at the new :ref:`class_name <doc_scripting_continued_class_name>`
3. Your own, custom classes. Look at the new :ref:`class_name <doc_gdscript_basics_class_name>`
feature to register types in the editor.
.. note::