Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
클래스 참조 입문
이 페이지에서는 클래스 참조를 작성하는 방법을 설명합니다. Godot의 내장 노드 유형에 대한 클래스, 메소드, 속성에 대한 새로운 설명을 어디에 작성하는지 배우게 됩니다.
더 보기
Git 버전 제어 시스템을 사용하여 Godot 프로젝트에 변경 사항을 제출하는 방법을 배우려면 `클래스 참조 기여 문서 <https://contributing.godotengine.org/en/latest/documentation/class_reference.html>`__를 참조하세요.
각 클래스에 대한 참조는 아래와 같은 XML 파일에 포함되어 있습니다.
<class name="Node2D" inherits="CanvasItem" version="4.0">
<brief_description>
A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index.
</brief_description>
<description>
A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order.
</description>
<tutorials>
<link title="Custom drawing in 2D">https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link>
<link title="All 2D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/2d</link>
</tutorials>
<methods>
<method name="apply_scale">
<return type="void">
</return>
<argument index="0" name="ratio" type="Vector2">
</argument>
<description>
Multiplies the current scale by the [code]ratio[/code] vector.
</description>
</method>
[...]
<method name="translate">
<return type="void">
</return>
<argument index="0" name="offset" type="Vector2">
</argument>
<description>
Translates the node by the given [code]offset[/code] in local coordinates.
</description>
</method>
</methods>
<members>
<member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position">
Global position.
</member>
[...]
<member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0">
Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others.
</member>
</members>
<constants>
</constants>
</class>
간단하고 긴 설명으로 시작됩니다. 생성된 문서에서 간략한 설명은 항상 페이지 상단에 표시되고 긴 설명은 메소드, 변수 및 상수 목록 아래에 표시됩니다. 별도의 XML 노드에서 메소드, 멤버 변수, 상수 및 시그널를 찾을 수 있습니다.
각각에 대해 Godot의 소스 코드에서 어떻게 작동하는지 배우고 싶습니다. 그런 다음 다음 태그의 텍스트를 완성하거나 개선하여 문서를 작성하세요.
설명
설명
PI 상수.
<method>`(`<description> 태그에 있음, 반환 유형 및 인수는 별도의 문서 문자열을 사용하지 않음)
<member>
<signal>`(`<description> 태그에 있음, 인수는 별도의 문서 문자열을 사용하지 않음)
PI 상수.
명확하고 간단한 언어로 작성하십시오. 설명을 짧고 읽기 쉽게 유지하려면 항상 `작성 지침 <https://contributing.godotengine.org/en/latest/documentation/guidelines/docs_writing_guidelines.html>`__을 따르십시오. 설명에 빈 줄을 두지 마십시오: XML 파일의 각 줄은 비어 있더라도 새 단락이 됩니다.
클래스 XML을 편집하는 방법
클래스 참조를 업데이트하려면 ``doc/classes/``에서 선택한 클래스에 대한 파일을 편집하세요. 폴더에는 각 클래스에 대한 XML 파일이 포함되어 있습니다. XML에는 클래스 참조에서 찾을 수 있는 상수와 메서드가 나열되어 있습니다. Godot는 자동으로 XML을 생성하고 업데이트합니다.
참고
엔진 소스 코드의 일부 모듈의 경우 대신 modules/<module_name>/doc_classes/ 디렉터리에서 XML 파일을 찾을 수 있습니다.
즐겨 사용하는 텍스트 편집기를 사용하여 편집하세요. 코드 편집기를 사용하는 경우 들여쓰기 스타일이 변경되지 않는지 확인하세요. XML에는 탭을 사용해야 하고 BBCode 스타일 블록 안에는 4개의 공백을 사용해야 합니다. 자세한 내용은 아래를 참조하세요.
생성된 문서에서 수정 사항이 올바른지 확인하려면 doc/ 폴더로 이동하여 make rst 명령을 실행하세요. 그러면 XML 파일이 온라인 문서의 형식으로 변환되고 문제가 있는 경우 오류가 출력됩니다.
또는 Godot를 빌드하고 내장 코드 참조에서 수정된 페이지를 열 수 있습니다. 엔진 컴파일 방법을 알아보려면 :ref:`컴파일 가이드 <toc-devel-compiling>`을 읽어보세요.
파일을 편안하게 편집하려면 Vim, Atom, Visual Studio Code, Notepad++ 등과 같은 XML 파일을 지원하는 코드 편집기를 사용하는 것이 좋습니다. 검색 기능을 사용하여 클래스와 속성을 빠르게 찾을 수도 있습니다.
팁
Visual Studio Code를 사용하는 경우 `vscode-xml 확장 <https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml>`__을 설치하여 클래스 참조 XML 파일에 대한 Linting을 얻을 수 있습니다.
API를 사용되지 않음/실험적으로 표시하기
API를 더 이상 사용되지 않거나 실험적인 것으로 표시하려면 해당 XML 속성을 추가해야 합니다. 속성 값은 API가 권장되지 않는 이유(BBCode 마크업 지원)를 설명하는 메시지이거나 빈 문자열(기본 메시지가 사용됨)이어야 합니다. API 요소가 더 이상 사용되지 않거나 실험적인 것으로 표시되면 설명이 비어 있어도 문서화된 것으로 간주됩니다.
<class name="Parallax2D" inherits="Node2D" experimental="This node is meant to replace [ParallaxBackground] and [ParallaxLayer]. The implementation may change in the future." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
[...]
</class>
<constant name="RESPONSE_USE_PROXY" value="305" enum="ResponseCode" deprecated="Many clients ignore this response code for security reasons. It is also deprecated by the HTTP standard.">
HTTP status code [code]305 Use Proxy[/code].
</constant>
<member name="auto_translate" type="bool" setter="set_auto_translate" getter="is_auto_translating" deprecated="Use [member Node.auto_translate_mode] instead.">
Toggles if any text should automatically change to its translated version depending on the current locale.
</member>
<method name="get_method_call_mode" qualifiers="const" deprecated="Use [member AnimationMixer.callback_mode_method] instead.">
<return type="int" enum="AnimationPlayer.AnimationMethodCallMode" />
<description>
Returns the call mode used for "Call Method" tracks.
</description>
</method>