Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Jak czytać dokumentacje Godot API

On this page, you'll learn how to read the class reference for the Godot API.

The API, or Application Programming Interface, is an index of what Godot offers users. It provides a brief summary of which classes exist, how they are related to each other, what features they have, and how to use them.

Dziedziczenie

../../_images/class_api_inheritance.webp

Na górze plików znajduje się nazwa klasy.

The "Inherits" section lists each class the current one inherits. Here CanvasItem inherits Node and Node inherits Object.

Segment "Dziedziczony Przez" zawiera klasy które są bezpośrednio dziedziczone przez aktualnie otwartą klase. Na przykładzie Control oraz Node2D dziedziczą po klasie CanvasItem.

Krótki Opis

../../_images/class_api_brief_description.webp

Next a brief description of the class. This text appears in Godot Editor popups for creating Nodes, Resources, and other types.

Opis

../../_images/class_api_description.webp

Next a more detailed description the class, its features, and its use case(s).

Reczy które możesz tutaj znaleźć:

  1. Szczegółowe informacje na temat działania klasy.

  2. Przykładowe wykorzystanie kodu w praktyce.

  3. Konkretne wykorzystanie dostępnych funkcji klasy.

  4. Ostrzeżenia o wymaganych zależnościach lub potrzebnej konfiguracji.

  5. Links to other related parts of the Godot API.

Tutorials

../../_images/class_api_tutorials.webp

Poniżej strona dostarcza linki do dokumentacji gdzie wspomniano bądź wykorzystano klasę.

Właściwości

../../_images/class_api_properties_table.webp

Tabela Właściwości przedstawia listę zmiennych, które posiada instancja klasy.

Lewa kolumna przedstawia rodzaj danych właściwości. Tekst ten jest także odnośnikiem do typu danych w API Godota.

The center column contains the name of the property. The text is also a link to that property's full description on the page. Use this name to get the property's data or set a new value to it.

The right column contains the default value of the property. To initialize it with a different value, you must set a different value via script or the Inspector.

Methods

../../_images/class_api_methods_table.webp

The Methods table lists the functions which belong to each instance of the class, also known as the "methods."

The left column contains the data type of the method's return value.

The right column contains the name, parameters, and qualifiers of the method. The name is the text before the opening parenthesis. It is also a link to the method's full description on the page. Use this name to call the method.

For each parameter, the page details its data type, name, and default value, if any.

Possible qualifiers include...

  • const: the method does not change any data in the class instance.

  • virtual: the method does nothing but wait for a script to override it.

  • vararg: the method can accept an arbitrary number of arguments.

Sygnały

../../_images/class_api_signals.webp

The Signals list details the names and parameters of events which "signal" a change in game state to other class instances.

Like the Methods table, any parameters will include their data type and name.

Each signal also has a detailed explanation of when the signal is emitted.

Enumerations

../../_images/class_api_enumerations.webp

The Enumerations list details the enumerable data types associated with the current class.

For each enumeration, the page states its name and then lists its possible values.

For each enumeration value, the page states its name, its integer value, and an explanation of its use case(s) and/or affects.

Stałe

../../_images/class_api_constants.webp

The Constants list details named integer constants in the current class.

For each constant, the page states its name, its integer value, and an explanation of its use case(s) and/or affects.

NOTIFICATION_* constants' descriptions will state which engine event triggers the notification.

Property Descriptions

../../_images/class_api_property_descriptions.webp

The Property Descriptions list details everything about each property.

It restates the data type and name of the property.

Every property in the Godot API is bound to a pair of setter and getter functions. Using either is equivalent. They are listed here.

Below that is a detailed summary of what the property's data represents, its use case(s) and/or the affects of changing it. It may include code samples and/or links to relevant parts of the Godot API.

Informacja

Knowing the setter and getter names is useful when one must bind a method name or Callable to something.

Method Descriptions

../../_images/class_api_method_descriptions.webp

The Method Descriptions list details everything about each method.

It restates the method's return data type, parameter names/types/defaults, and qualifiers.

Below that is a detailed summary of what the method does and its use case(s). It may include code samples and/or links to relevant parts of the Godot API.